16.35 Midterm Debrief - PowerPoint PPT Presentation

About This Presentation
Title:

16.35 Midterm Debrief

Description:

Who are the expected readers of a requirement specification and what properties ... input data that makes the program follow each path (if it turns out that there ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 22
Provided by: maliask
Learn more at: http://web.mit.edu
Category:
Tags: debrief | midterm | serve

less

Transcript and Presenter's Notes

Title: 16.35 Midterm Debrief


1
16.35 Midterm Debrief
  • October 30, 2002
  • Malia Kilpinen

2
Question 1
  • What are process models? Compare and contrast
    the spiral model of development with another
    model of your choice. (15p)

3
Solution 1 - Process Model
  • A software process model is an abstract
    representation of a process. It presents a
    description of a process from some particular
    perspective.

4
Solution 1 - Spiral Model
  • Process is represented as a spiral rather than as
    a sequence of activities with backtracking.
  • Each loop in the spiral represents a phase in the
    process.
  • No fixed phases such as specification or design
    -loops in the spiral are chosen depending on what
    is required.
  • Risks are explicitly assessed and resolved
    throughout the process.

5
Solution 1 - Spiral Model
  • Objective Setting
  • Risk assessment and reduction
  • Development and validation
  • Planning
  • ltltThere is a picture in Van Vliet pg 62.gtgt

6
Question 2
  • Who are the expected readers of a requirement
    specification and what properties do they want
    the specification to have? (5p)

7
Solution 2
  • Users and the customer (in case of custom-made
    product)
  • want readability, completeness, consistency,
    correctness, may serve as a contract
    (testability)
  • Designers
  • readability, consistency, non-ambiguity,
    traceability
  • Testers
  • testability
  • Maintenance staff
  • completeness, traceability

8
Question 3
  • Consider the following piece of program, which
    assumes a large integer C and an array A(0..C).
    It is intended to assign the maximum of A to the
    variable max.
  • max A(0)
  • i 1
  • while i lt C loop
  • i i1
  • if A(i) gt max
  • then max A(i)
  • end if
  • -- max is the maximum of A(0..i)
  • end loop

9
Question 3 (cont.)
  • a) Show what steps must be taken to find test
    cases for coverage testing, using this program as
    an example. Show the distinction between
    node-coverage and branch-coverage. (5p)
  • b) What method(s) of verification are both
    practical and would likely reveal the error? Note
    that C is large. Motivate your answer. (3p)

10
Solution 3 - Part a
  • 1) draw flow-chart, identify nodes and branches
  • 2) find a collection of paths that visits all
    nodes/branches
  • 3) find input data that makes the program follow
    each path (if it turns out that there is no such
    data, the path is infeasible, go back to 2 and
    replace it by other paths)
  • in this case, the difference is that branch
    coverage requires that the test A(i)gtmax is true
    sometimes, and false sometimes. For node
    coverage, it may always be true. In any case,
    only one test is necessary. Say C3, and
    A5,2,3,6

11
Solution 3 - Part b
  • The error is that A(1) is never checked. A
    statistical test has probability 1/C to detect
    this.
  • From a) we can see that it is easy to achieve
    branch coverage and yet miss the error.
  • A boundary value test might detect it, if you
    have a rather broad definition of boundary.
    Such a definition will soon be unworkable.
    Inspection has a good chance.
  • (Formal verification, that can be done mostly
    automatically when loop invariants are provided,
    is another candidate.)

12
Question 4
  • Describe the architectures repository model and
    client-server. Compare their pros and cons. (6p)

13
Solution 4 - Repository
  • Advantages
  • Efficient way to share large amounts of data
  • Sub-systems need not be concerned with how data
    is produced
  • Centralized management e.g. backup, security,
    etc.
  • Disadvantages
  • Sub-systems must agree on a repository data
    model. Inevitably a compromise
  • Data evolution is difficult and expensive
  • No scope for specific management policies
  • Difficult to distribute efficiently

14
Solution 4 - Client Server
  • Advantages
  • Distribution of data is straightforward
  • Makes effective use of networked systems. May
    require cheaper hardware
  • Easy to add new servers or upgrade existing
    servers
  • Disadvantages
  • No shared data model so sub-systems use different
    data organisation. data interchange may be
    inefficient
  • Redundant management in each server
  • No central register of names and services - it
    may be hard to find out what servers and services
    are available

15
Question 20
  • Cow-moon Ada code trace problem. (2p)

16
Solution 20
  • Output is
  • 3 14
  • Moo! Moo! Moo! Moo!
  • 7 6

17
Question 21
  • What does it mean to declare a variable as
    private? When would you declare a variable as
    private? (1p)

18
Question 22
  • Write a program to calculate the cube of a
    user-inputted integer. Your program should
    include error checking. (6p)

19
Solution 22
  • Should use Skip_Line function in error checking.
  • Simplified version of problem set 2.

20
Question 23
  • Assume that a record type Beep has been defined.
    The following pointers are then declared (1p)
  • type BeepPointer is access Beep
  • Audi, BMW BeepPointer
  • Audi new Beep
  • BMW new Beep
  • What is the difference between the following
    commands?
  • BMW Audi
  • BMW.all Audi.all

21
Solution 23
  • Discussed in Ada Compendium.
  • BMW Audi
  • BMW points to Audis memory location
  • BMW.all Audi.all
  • BMW holds same values as Audi
Write a Comment
User Comments (0)
About PowerShow.com