CS135 Flashcards
(84 cards)
Define Software Engineering.
The application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software.
What is the main goal of software engineering?
To deliver high-quality software that is functional, secure, maintainable, and meets deadlines and budgets.
Explain why maintenance cost is a major concern in SE.
More than 50% of lifecycle costs are due to maintenance, making understandability and documentation crucial.
What are the typical documents produced in the Waterfall Model?
Requirements, Specification, Design Documents, User Manuals, Test Data, and Evaluation Reports.
Explain the difference between black-box and white-box testing.
Black-box testing is based on specification; white-box testing is based on internal code structure.
What does JUnit automate?
Test execution and evaluation.
What is meant by ‘Design by Contract’ in Dafny?
A method specifies its required inputs (preconditions) and guaranteed outputs (postconditions).
Describe Boundary Value Analysis (BVA) and when it is useful.
A black-box technique focusing on the edges of input domains, useful for catching off-by-one errors.
What are the five typical input values used in BVA?
min, min+, nom, max-, max
What is an equivalence class in software testing?
A subset of inputs that the system treats the same; testing one value from each is often sufficient.
What are the components of a test case?
Name, input(s), expected result, and actual result (for evaluation).
When can a test suite be called minimal?
When no test case can be removed without reducing its coverage.
Define C0, Cp, and Ci(k) coverage criteria.
C0: statement coverage; Cp: branch coverage; Ci(k): loop coverage up to k iterations.
How does Ci(2) work in loop testing?
It checks loop behavior for 0, 1, and 2 iterations.
Why is complete testing impossible?
The input space is often too large to test every possible case (e.g., for ints: billions of values).
Compare testing vs program verification.
Testing samples input space; verification (e.g. Dafny) symbolically proves correctness for all inputs.
What is a weakest precondition (WP)?
The least restrictive condition under which a statement guarantees a postcondition.
Explain loop invariants in Dafny.
Conditions that must hold before and after every loop iteration; essential for correctness proofs.
What does the keyword ‘assert’ do in Dafny?
Checks a condition at a point in code; if it fails, verification stops.
How is substitution used in WP calculations?
To replace variables with expressions in postconditions to compute preconditions.
What replaces specifications in Extreme Programming (XP)?
Tests that define the system’s expected behavior.
What are XPs coding principles?
Write tests first; perform 10-minute builds; frequent integration.
What is a ‘story’ in XP?
A small, user-visible feature or functionality unit.
What is the advantage of pair programming in XP?
Improved code quality and shared knowledge through constant peer review.