Docsity

Introduction to Software Engineering - Assignment Kit for Program 3 | CS 350, Assignments of Software Engineering

Partial preview of the text

Download Introduction to Software Engineering - Assignment Kit for Program 3 | CS 350 and more Assignments Software Engineering in PDF only on Docsity!

CS 350: Assignment Kit for

Program 3

Fall 2005

Version 1.1 (subject to revision)

Personal Software Process for Engineers

Assignment Kit for Program 3

Overview

Overview This assignment kit covers the following topics.

Section See Page Prerequisites (^2) Program 3 requirements (^3) Numerical integration with Simpson’s rule (^4) The t distribution (^6) Using the t distribution in the PSP (^6) An example (^9) Assignment instructions (^11) PSP1 planning script (^12) Due dates and evaluation criteria (^18)

Prerequisites Reading

  • Chapters 6

Numerical integration with Simpson’s rule

Overview (^) Numerical integration is the

process of determining the area “under” some function.

Numerical integration calculates this area by dividing it into vertical “strips” and summing their individual areas.

The key is to minimize the error in this approximation.

Simpson’s rule Simpson’s rule can be used to integrate a symmetrical statistical distribution function over a specified range (e.g., from 0 to some value x ).

  1. num_seg = initial number of segments, an even number
  2. W = x / num_seg , the segment width
  3. E = the acceptable error, e.g., 0.
  4. Compute the integral value with the following equation.

= + ∑ + ∑ +

−

=

−

=

F FiW FiW F x

W

p

num seg

i

numseg

i

_ 2

2 , 4 , 6 ...

_ 1

1 , 3 , 5 ...

  1. Compute the integral value again, but this time with num_seg = num_seg *2.
  2. If the difference between these two results is greater than E, double num_seg and compute the integral value again. Continue doing this until the difference between the last two results is less than E. The latest result is the answer.

Continued on next page

In t egr a t in g a fu n ction

Numerical integration with Simpson’s rule, Continued

A simple example Let’s look at a simple function, where F( x ) = 2 x.

Note: This example is a triangle. The area of a triangle is

( base )( height )

In this example, we can expand Simpson’s rule

= + ∑ + ∑ +

−

=

−

=

F FiW FiW F x

W

p

num seg

i

num seg

i

_ 2

2 , 4 , 6 ...

_ 1

1 , 3 , 5 ...

to

[ ( 0 ) 4 ( 1 ) 2 ( 2 ) 4 ( 3 ) ( ) 4 ]

3

1 p = F + F + F + F + F

and then substitute calculated values for the function F( x )= 2 x

[ ( )] [ ] 16

3

48 0 8 8 24 8 3

1 ( 0 ) 4 ( 2 ) 2 ( 4 ) 4 ( 6 ) 8 3

1 p = + + + + = + + + + = =

F( x ) = 2 x num_seg = 4 W = 4/4 = 1

x = 4

The t distribution, Continued

T distribution function

When numerically integrating the t distribution with Simpson’s rule, use the following function.

2 (^1 )^ /^2

1 / 2

− +

⎟⎟ ⎠

Γ⎛^ +

dof

dof

x dof dof

dof

F x

where

  • dof = degrees of freedom
  • Γ is the gamma function

The gamma function is Γ ( x ) =( x − 1 )Γ( x − 1 ), where

  • Γ( 1 )= 1
    • Γ ( 1 / 2 )= π

Continued on next page

The t distribution, Continued

An example of calculating gamma for an integer value

Γ ( x )for integer values is Γ( x ) = ( x − 1 )!.

An example of calculating gamma for a non-integer value

⎟ ⎠

⎞ ⎜ ⎝

= Γ⎛ ⎟ ⎠

⎞ ⎜ ⎝

Γ⎛ 2

5 2

5

2

7 2

7 2

7

⎟ ⎠

⎞ ⎜ ⎝

= Γ⎛ ⎟ ⎠

⎞ ⎜ ⎝

Γ⎛ 2

3 2

3

2

5

2

7 2

5 2

5

2

7

⎟ ⎠

⎞ ⎜ ⎝

= Γ⎛ ⎟ ⎠

⎞ ⎜ ⎝

Γ⎛ 2

1 2

1

2

3

2

5

2

7 2

3 2

3

2

5

2

7

    1. 63173 2

1

2

3

2

5

2

7 2

1 2

1

2

3

2

5

2

7 ⎟= = ⎠

⎞ ⎜ ⎝

Γ⎛ π

An example, Continued

Example, continued

  1. Compute the integral value again, but this time with num_seg = 20. The new result is 0.35005864.
  2. We compare the new result to the old result.
    1. 3500589 − 0. 35005864 < E
  3. We can then return the value p =0.35005864.

Assignment instructions

Assignment instructions

Before starting program 3, review the top-level PSP1 process script below to ensure that you understand the “big picture” before you begin. Also, ensure that you have all of the required inputs before you begin the planning phase.

PSP1 Process Script

Purpose To guide the development of module-level programs Entry Criteria - Problem description

  • PSP1 Project Plan Summary form
  • Size Estimating template
  • Historical size and time data (estimated and actual)
  • Time and Defect Recording logs
  • Defect Type, Coding, and Size Measurement standards
  • Stopwatch (optional)

Step Activities Description 1 Planning - Produce or obtain a requirements statement.

  • Use the PROBE method to estimate the added and modified size of this program.
  • Complete the Size Estimating template.
  • Use the PROBE method to estimate the required development time.
  • Enter the plan data in the Project Plan Summary form.
  • Complete the Time Recording log. 2 Development - Design the program.
  • Implement the design.
  • Compile the program, and fix and log all defects found.
  • Test the program, and fix and log all defects found.
  • Complete the Time Recording log. 3 Postmortem Complete the Project Plan Summary form with actual time, defect, and size data.

Exit Criteria -^ A thoroughly tested program

  • Completed Project Plan Summary form with estimated and actual data
  • Completed Size Estimating template
  • Completed Test Report template
  • Completed PIP forms
  • Completed Time and Defect Recording logs

Continued on next page

Assignment instructions, Continued

Use the PROBE method to create size and resource estimates.

Purpose To guide the size and time estimating process using the PROBE method Entry Criteria - Requirements statement

  • Size Estimating template and instructions
  • Size per item data for part types
  • Time Recording log
  • Historical size and time data General - This script assumes that you are using added and modified size data as the size-accounting types for making size and time estimates.
  • If you choose some other size-accounting types, replace every “added and modified” in this script with the size-accounting types of your choice.

Step Activities Description 1 Conceptual Design Review the requirements and produce a conceptual design. 2 Parts Additions Follow the Size Estimating Template instructions to estimate the parts additions and the new reusable parts sizes. 3 Base Parts and Reused Parts

  • For the base program, estimate the size of the base, deleted, modified, and added code.
  • Measure and/or estimate the side of the parts to be reused. 4 Size Estimating Procedure
  • If you have sufficient estimated proxy size and actual added and modified size data (three or more points that correlate), use procedure 4A.
  • If you do not have sufficient estimated data but have sufficient plan added and modified and actual added and modified size data (three or more points that correlate), use procedure 4B.
  • If you have insufficient data or they do not correlate, use procedure 4C.
  • If you have no historical data, use procedure 4D. 4A Size Estimating Procedure 4A
  • Using the linear-regression method, calculate the β 0 and β 1 parameters from the estimated proxy size and actual added and modified size data.
  • If the absolute value of β 0 is not near 0 (less than about 25% of the

expected size of the new program), or β 1 is not near 1.0 (between about

0.5 and 2.0), use procedure 4B. 4B Size Estimating Procedure 4B

  • Using the linear-regression method, calculate the β 0 and β 1 parameters from the plan added and modified size and actual added and modified size data.
  • If the absolute value of β 0 is not near 0 (less than about 25% of the

expected size of the new program), or β 1 is not near 1.0 (between about

0.5 and 2.0), use procedure 4C. 4C Size Estimating Procedure 4C

If you have any data on plan added and modified size and actual added and

modified size, set β 0 = 0 and β 1 = (actual total added and modified size to

date/plan total added and modified size to date). 4D Size Estimating Procedure 4D

If you have no historical data, use your judgment to estimate added and modified size. (continued)

Continued on next page

Assignment instructions, Continued

PROBE Estimating Script (Continued)

Step Activities Description 5 Time Estimating Procedure

  • If you have sufficient estimated proxy size and actual development time data (three or more points that correlate), use procedure 5A.
  • If you do not have sufficient estimated size data but have sufficient plan added and modified size and actual development time data (three or more points that correlate), use procedure 5B.
  • If you have insufficient data or they do not correlate, use procedure 5C.
  • If you have no historical data, use procedure 5D. 5A Time Estimating Procedure 5A
  • Using the linear-regression method, calculate the β 0 and β 1 parameters from the estimated proxy size and actual total development time data.
  • If β^0 is not near 0 (substantially smaller than the expected development

time for the new program), or β 1 is not within 50% of 1/(historical

productivity), use procedure 5B. 5B Time Estimating Procedure 5B

  • Using the linear-regression method, calculate the β 0 and β 1 regression parameters from the plan added and modified size and actual total development time data.
  • If β 0 is not near 0 (substantially smaller than the expected development

time for the new program), or β^1 is not within 50% of 1/(historical

productivity), use procedure 5C. 5C Time Estimating Procedure 5C

  • If you have data on estimated – added and modified size and actual

development time, set β 0 = 0 and β^1 = (actual total development time to

date/estimated – total added and modified size to date).

  • If you have data on plan – added and modified size and actual

development time, set β 0 = 0 and β 1 = (actual total development time to

date/plan total added and modified size to date).

  • If you only have actual time and size data, set β 0 = 0 and β 1 = (actual total development time to date/actual total added and modified size to date). 5D Time Estimating Procedure 5D

If you have no historical data, use your judgment to estimate the development time from the estimated added and modified size. 6 Time and Size Prediction Intervals

  • If you used regression method A or B, calculate the 70% prediction intervals for the time and size estimates.
  • If you did not use the regression method or do not know how to calculate the prediction interval, calculate the minimum and maximum development time estimate limits from your historical maximum and minimum productivity for the programs written to date.

Exit Criteria -^ Completed estimated and actual entries for all pertinent size categories

  • Completed PROBE Calculation Worksheet with size and time entries
  • Plan and actual values entered on the Project Plan Summary

Continued on next page

Assignment instructions, Continued

Postmortem phase Conduct the postmortem following the PSP1 postmortem script.

PSP1 Postmortem Script Purpose To guide the PSP postmortem process Entry Criteria - Problem description and requirements statement

  • Project Plan Summary form with program size and development time data
  • Completed Test Report template
  • Completed Time and Defect Recording logs
  • A tested and running program that conforms to the coding and size measurement standards

Step Activities Description 1 Defect Recording - Review the Project Plan Summary to verify that all of the defects found in each phase were recorded.

  • Using your best recollection, record any omitted defects. 2 Defect Data Consistency
  • Check that the data on every defect in the Defect Recording log are accurate and complete.
  • Verify that the numbers of defects injected and removed per phase are reasonable and correct.
  • Using your best recollection, correct any missing or incorrect defect data. 3 Size - Count the size of the completed program.
  • Determine the size of the base, reused, deleted, modified, added, total, added and modified, and new reusable code.
  • Enter these data in the Project Plan Summary form. 4 Time - Review the completed Time Recording log for errors or omissions.
  • Using your best recollection, correct any missing or incomplete time data.

Exit Criteria -^ A thoroughly tested program that conforms to the coding and size measurement standards

  • Completed Test Report template
  • Completed Project Plan Summary form
  • Completed PIP forms describing process problems, improvement suggestions, and lessons learned
  • Completed Time and Defect Recording logs

Verify that you have met all of the exit criteria for the PSP1 postmortem phase, then submit your assignment.

Continued on next page

Assignment instructions, Continued

Due dates

Submitting your assignment

Project plan, preliminary estimates: Sat., Sept. 24. Completed project (code, forms, test data): Thurs. Sept. 29.

When you’ve completed the postmortem phase, submit your assignment package, source code, and test results to cs350.

The order for the assignment package is

  • PSP1 Project Plan Summary form
  • Test Report template
  • PIP form
  • Size Estimating template
  • PROBE Calculation worksheet
  • Time Recording log
  • Defect Recording log
  • source code