CS511 Midterm

(This test is worth 20% of your overall course grade. Each problem is worth an equal amount within that. Put the answers in order in your exam books. Put your name/ID on each book.)

1. Explain boundary/edge testing. Why is it particularly useful? (Must get both parts for full credit.)

Boundary/edge testing is testing the extreme inputs to a program or subroutine -- the highest number, or the most negative number, or the fastest signal, or the largest file, or the smallest file.

It is useful because bugs often occur with these kinds of input, since programmers tend to forget about these cases.

2. List 4 of my top 6 reasons that software often is late.

Scope creep; expanding the project as it goes along.

Deliberately underestimating in order to get the work.

As a management motivation tool; give people an impossible deadline as a way to get them to work fast.

Expecting that all will go well; being overly optimistic.

Basing the time estimate only on an external, immovable deadline.

New problem domain or technology.

3. Explain software verification and validation.

Validation -- checking that the functional specification matches what the user really wants.

Verification -- checking that the software meets its functional specification.

4. What are the two kinds of comments that you should have in your source code?

Summary of a block of code.

Description of the code's intent; or explanation of why the code was written.

5. Does it make sense to write comments before code? Why or why not? (Must have 2 reasons to support your answer for full credit.)

Yes it does. Here's why...

Writing the comments first helps you to think through what the code should do.

Writing the comments first allows you to mentally debug the code and find errors before you code them.

When you are finished coding, the comments are already done.

The comments are very likely to match the code, since you wrote the code based on the comments.

6. What is defect amplification?

This is when a single error early in the software development process becomes many errors later in the process.

Or, when errors multiply as the software process goes forward.

Or, when an error/bug in software become more widespread throughout the code later in the software process.

7. What is our definition of software quality? (Must have 5 aspects for full credit. 1/2 credit for 3 aspects.)

The software matches its specification.

There is a small number of acceptable bugs.

The software is on time and budget.

The software is beneficial to users.

The software has good internal structure. Or, the software is well designed.

8. Describe the role of software in system analysis or system engineering.

Within system analysis, software is just one part of a larger system that can include people, manufacturing, hardware, business processes, etc. The overall system may or may not include software at all.

9. Describe 2 of the problems with doing a formal requirements analysis.

It is time consuming and tedious.

Users often don't know, or can't say, what they really want.

The requirements may change after you write them down.

Sometimes you don't know some of the requirements until you actually use the software.

10. What are the 3 important goals of software engineering, from our definition of software engineering? (1/2 credit for 2 goals.)

High quality

Efficient use of people and resources

Predictable schedule

11. Describe the design phase of the "code and fix" software development model.

There is no design phase.

Or, the design phase is done together with coding and debugging all at once.

12. In the waterfall model of software development, how does the coding phase affect the design phase?

It doesn't. The design is completely finished before coding begins.

13. Writing one large program has a number of advantages over breaking the code into many subroutines. With one large program, there are probably fewer lines of code, and there is no execution time wasted with subroutines calls. Why is one large program not a good idea in general?

One big program is too complicated (this is the key idea). For any sizable program, no one will be able to understand it. Program will not be modifiable or maintainable.

14. Explain cohesion and coupling. Do we want a lot or a little of each? (Must get all 4 parts for full credit.)

Cohesion -- the degree to which a subroutine/function is concerned with just one thing. We want a lot of cohesion.

Coupling -- the degree to which a subroutine/function is intertwined/linked with other code. We want low coupling.

(OK to explain that these are two aspects of independence.)

15. In general, how do we know when to stop testing software and declare it "done", or at least done for now. (Full credit for 3 criteria, 1/2 credit for 2 criteria.)

All known and probable major bugs are gone.

Count of minor bugs is acceptable and decreasing.

Performance and usability are good.