Chapter 2 Flashcards
(47 cards)
Software Engineering
An emerging field related to a branch of computer science that provides techniques to facilitate the development of computer programs.
Problem Solving
Refers to the entire process of taking the statement of a problem and developing a computer program that solves that problem
Solution
Consists of two components: algorithms and ways to store data.
Algorithm
A step-by-step specification of a method to solve a problem within a finite amount of time.
Life cycle of software
This process begins with an initial idea, includes the writing and debugging of programs, and continues for years to involve corrections and enhancements to the original software.
What are the phases in the life cycle of typical software?
- Specification
- Design
- Risk Analysis
- Verification
- Coding
- Testing
- Refining the solution
- Production
- Maintenance
What are the phases in the life cycle of typical software?
1. Specification
Given an initial statement of the software’s purpose, you must specify clearly all aspects of the problem.
Prototype program
Simulates the behavior of portions of the desired software product. You can view these specifications as the terms of a contract between your method and the code that calls it.
What are the phases in the life cycle of typical software?
2. Design
After Specification, you must design a solution to the problem. The best way to do this is to simplify the problem-solving process is to divide it into small, manageable parts. the resulting program will contain modules.
Modules
Self-contained units of code.
Loosely coupled
Classes should be designed so that the objects are independent. When loosely coupled, changes in one object will have minimal effects on other objects in the program.
Highly coupled
If every object in a program is connected to every other object. Means that the flow of information between objects is potentially high.
Cohesion
The degree to which the data and methods of an object are related. Highly cohesive methods each perform one well-defined task.
Data flow
Objects interact by sending messages to each other through method calls.
Contract
If you alone write the entire program, this contract helps you semantically decompose the problem into smaller tasks. If the program is a team project, the contract helps delineate responsibilities.
Precondition
A statement of the conditions that must exist at the beginning of a method.
Postcondition
A statement of the condition at the end of a method.
Java Application Programming Interface (API)
A protocol intended to be used as an interface bysoftware components to communicate with each other
What are the phases in the life cycle of typical software?
3. Risk Analysis
Building software entails risks. Some risks are the same for all software projects and some are peculiar to a particular project. Risks can affect a project’s timetable or cost, the success of a business, or the health and lives of people.
What are the phases in the life cycle of typical software?
4. Verification
Formal, theoretical methods are available for proving that an algorithm is correct.
Assertion
A statement about a particular condition at a certain point in an algorithm.
Invariant
A condition that is always true at a particular point in an algorithm. By using these, you can detect errors before you begin coding and thereby reduce your debugging and testing time.
Loop Invariant
A condition that is true before and after each execution of an algorithm’s loop. These can help you to write correct loops.
What are the steps to establish the correctness of an algorithm.
- The invariant must be true initially
- An execution of the loop must preserve the invariant.
- The invariant must capture the correctness of the algorithm.
- The loop must terminate.