Docsity

CS 350: Assignment Kit for Program 2 - Linear Regression in Software Engineering - Prof. J, Assignments of Software Engineering

Partial preview of the text

Download CS 350: Assignment Kit for Program 2 - Linear Regression in Software Engineering - Prof. J and more Assignments Software Engineering in PDF only on Docsity!

CS 350: Assignment Kit for

Program 2

Fall 2005

Version 1.0 (subject to revision)

Personal Software Process for Engineers: Part I

Assignment Kit for Program 2

Overview

Overview This assignment kit covers the following topics. Section See Page Prerequisites (^2) Program 2 requirements (^3) Regression overview (^5) Using regression in the PSP (^6) Calculating regression (^7) A regression example (^8) Assignment instructions (^10) Due dates and evaluation criteria (^15) Reference PSP text

  • Chapters 5 and 6

Program 2 requirements, Continued

Expected results Table 2

Regression

Overview Linear regression is a way of optimally fitting a line to a set of data. The linear regression line is the line where the distance from all points to that line is minimized. The equation of a line can be written as y   0   1 x In Figure 1, the best fit regression line has parameters of ^0 = -4.0389 and  1 = 0.1681. Figure 1 Continued on next page y = -4.0389 +0.1681x 0

Estimated Proxy Size Actual Development Hours

Regression, Continued

Calculating regression The formulas for calculating the regression parameters ^0 and  1 are

2 1 2 1 1 avg n i i avg avg n i i i

x nx
xy nx y
^ 

    0  y (^) avg   1 x avg where

  •  is the symbol for summation
  • i is an index to the n numbers
  • x and y are the two paired sets of data
  • n is the number of items in each set x and y
  • xavg^ is the average of the x values
  • yavg^ is the average of the y values Additional requirements Coding style: You must use the class coding standard for this code. The standard is available on the class web page in the same place as this assignment file. Input: Your program should read from standard input and read until end of file. It should also write to standard output. The files it read should contain only data to be used in computing the regression coefficients. Thus, if you were to compile your program and name the executable prog2, and your test data files were named data1, data2, and data3, your program could be run on these three files by typing:

./prog2 < data ./prog2 < data ./prog2 < data List structure: As in program one, you should again store the data in a linked list.

A regression example

A regression example In this example, we will calculate the regression parameters ( ^0 and  1 values) of the data in the Table 3. n x y 1 130 186 2 650 699 3 99 132 4 150 272 5 128 291 6 302 331 7 95 199 8 945 1890 9 368 788 10 961 1601 Table 3

2 1 2 1 1 avg n i i avg avg n i i i

x nx
xy nx y

  

  1. In this example there are 10 items in each dataset and therefore we set n =
  2. We can now solve the summation items in the regression formula. n x y x^2 x*y 1 130 186 16900 24180 2 650 699 422500 454350 3 99 132 9801 13068 4 150 272 22500 40800 5 128 291 16384 37248 6 302 331 91204 99962 7 95 199 9025 18905 8 945 1890 893025 1786050 9 368 788 135424 289984 10 961 1601 923521 1538561 Tota

l 

10 1

i

x i 

10 1

i

y i 

10 1

i

x i 

10 1

i xi y i

  1. 8 10 3828 xavg   638. 9 10 6389 yavg   Continued on next page

Assignment instructions

Assignment instructions Before starting program 2, review the top-level PSP0.1 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. PSP0.1 Process Script Purpose To guide the development of module-level programs Entry Criteria - Problem description

  • PSP0.1 Project Plan Summary form
  • Time and Defect Recording logs
  • Defect Type, Coding standards
  • Stopwatch (optional) Step Activities Description 1 Planning - Produce or obtain a requirements statement.
  • Estimate the added and modified size of this program.
  • 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 PIP forms
  • Completed Time and Defect Recording logs Continued on next page

Assignment instructions, Continued Planning phase Plan program 2 following the PSP0.1 planning phase script. PSP0.1 Planning Script Purpose To guide the PSP planning process Entry Criteria - Problem description

  • PSP0.1 Project Plan Summary form
  • Time Recording log Step Activities Description 1 Program Requirements
  • Produce or obtain a requirements statement for the program.
  • Ensure that the requirements statement is clear and unambiguous.
  • Resolve any questions. 2 Size Estimate Make your best estimate of the added and modified size of this program. 3 Resource Estimate
  • Make your best estimate of the time required to develop this program.
  • Using the To Date % from the most recently developed program as a guide, distribute the development time over the planned project phases. Exit Criteria -^ Documented requirements statement
  • Completed Project Plan Summary form with estimated program size and development time data
  • Completed Time Recording log Verify that you have met all of the exit criteria for the planning phase, then proceed to the development phase. Continued on next page

Assignment instructions, Continued

Postmortem phase Conduct the postmortem following the PSP0.1 postmortem script. PSP0.1 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 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

Submitting your assignment When you’ve completed the postmortem phase, place all items to be submitted in a directory, then submit that directory using the submit command. The following should be included in your submission directory:

  • PSP1 Project Plan Summary form
  • Test Report template
  • PIP form  Time Recording log
  • Defect Recording log
  • source program listing
  • test results