All lessons Flashcards
(37 cards)
What is software engineering?
A computer is a programmable device, so the essence of computing is programming. Program development is the most essential use of a computer. Software engineering is the study of program development. How to do it efficiently, develop reliable programs, etc. Considers any software development activity software engineering.
the systematic application of methods to build software in a rigorous way. It involves technically building the system but also understanding requirements, working with stakeholders, finding a solution that balances stakeholder’s needs
Why do we need software engineering?
Software is everywhere around us, to the point that the way we build and maintain our software effects our quality of life.
It can make the difference between a fun product and something the user hates, a successful company and a failed company, and in some examples life and death.
Example of a system that wasn’t engineered correctly: healthcare.gov (somewhere between requirements, architecture, politics, project management went wrong).
How was the software engineering discipline born?
In the 60s, people realized they weren’t able to build the software they needed, resulting in the SOFTWARE CRISIS.
Software Crisis:
1 - Rising demand for software (moving from HW to SW in our products)
The demand for software at companies (NASA, Boeing) grew exponentially between 60s and 2000
2 - Effort required for larger systems doesn’t increase linearly:
Programming effort = individual could (heroically) do it right themselves, Software engineering = team
Developer tools will never catch up with increased complexity in demand
3 - Developer’s productivity growth: developer’s abilities can’t keep up with what’s needed in terms of size/complexity:
Gap between what’s needed and what’s available
Various software processes
- Waterfall
- Go from 1 phase to the other in the same way water follows the flow in a waterfall
- Evolutionary Prototyping
- Start with a prototype, and evolve it based on feedback from the customer
- RUP/USP (Rational Unified Process/Unified Software Process)
- Heavily based on use of UML
- Agile
- Sacrifice the discipline a little bit to be more flexible and account for changes in requirements
Software process
- Requirements engineering (implies business modeling beforehand)
- Talk to customer, stakeholders, whoever we’re building SW for, to understand what kind of system we’re trying to build
- Design
- High-level structure, that can become more detailed, of our software system
- Implementation
- Write code that implements the design that we just defined
- Verification/Validation
- Make sure the code behaves as intended
- Maintenance
- Adding new functionality, eliminating bugs, responding to problems reported from the field after it’s released
Automated tools are ______ in software engineering.
FUNDAMENTAL
Not only for productivity. Not only efficiency, but also effectiveness
Software development mistakes
- People-related
- Heroics
- Work environment
- People management
- Process-related
- Scheduling issues
- Planning issues
- Failures (low quality, lost deliverables)
- Product-related
- Gold-plating requirements
- Feature creep
- R != D
- If your project requires you to develop new algorithms, it’s more research than development, and therefore it should be managed accordingly (you’ll have a highly unpredictable schedule)
- Technology-related
- Silver bullet syndrome:
- situations in which there’s too much reliance on some previously unused technology
- Switching tools in the middle of a product: almost always has negative effects due to learning curves
- Lack of an automated VCS
- Silver bullet syndrome:
What is an IDE?
A software application that supports software developers and has many useful features
Tools are the cornerstone of the software engr. discipline
Requirements Engineering
- The process of establishing the services that the customer requires from the software system
- Also details with the constraints under which the system operates
- Important because:
- Many errors are made in Req Specifications
- Many are not detected early. Key is to detect them in RE.
What is object-oriented programming?
- OO means to give precedence of data over function
- Data items rather than functionality become the center of development activities
- Allows for enforcing the very important concept of information hiding:
- Encapsulation and segregation of data behind well-defined and (ideally) stable interfaces
- Encapsulation and information hiding terms are often used interchangeably, although some people prefer to think of IH as being the principle and encapsulation being the technique to achieve it. The key idea is to hide data behind a wall and only give access through interfaces that you, the developer, define.
- Makes code more maintainable, because other code doesn’t have to be concerned about the “How” for an object, just that it works.
- Also allows for reuse of object definitions with incremental refinements, called inheritance.
- An object is a computing unit organized around a collection of state or instance variables that define the state of the object
What is software architecture?
The set of principal design decisions about the system
- Most decisions don’t affect the system (e.g. choosing a for loop instead of while loop). The principal decisions, however, do
- Sometimes, distinctions between these 2 types of decisions is clear. Other times, it’s fuzzy. Bottom line is that if you believe something is an important design decision, that becomes an architectural decision
- SWA is like a blueprint for a SW system. Encompasses every facet of the system:
- structure
- behavior
- interactions
- non-functional properties
Cohesion
measure of how strongly related the elements of a model are. We want modules to cooperate to provide a specific piece of functionality
Low coupling = high cohesion
REST
Representational State Transfer
- hybrid arch style for distributed hypermedia systems, that is derived from several other network-based architectural styles, and that is characterized by uniform connector interface
- Extremely well-known, very widely-used, because it is basically the architectural style that covers the world wide web
Software Design: how to analyze requirements with a client (AKA stakeholder)
- Have them write out the requirements (numbered list)
- Go through the req’s and underline the nouns, and write them as classes in a class diagram
- Then analyze the diagram you just created to see if you can eliminate/combine
- Then go back to the requirements list and look for things that may not have been obvious the first time
- Start adding attributes when it makes sense, and walk the client through what they mean
- Finally, work on operations (starting by underlining verbs in req’s)
- Verbs that clearly express an action
- Do all of this in UML
- At the end, when the diagram is done, encourage the client that they’re doing well, and ask them to think of anything they want to add or that needs to be changed. They should be able to do this now that the UML has been sketched out and they understand it.
- Debriefing: Ask what the client thought of it, whether they think it was useful, and if maybe they learned something about their own system (things they knew but never explicitly wrote down). This kind of analysis/exercise can help them figure out if there’s any kind of issues in their requirements.
Software design patterns
- It can be difficult to come up with an effective design for a system. Design patterns can help by providing general reusable solutions to common recurring design problems
- Similar to architectural designs, design patterns can help developers build better designed systems by refusing design systems that worked well in the past and building on those solutions
5 main classes of design patterns
- Fundamental
- Creational
- Support object creation
- Structural
- Help compose objects/put them together
- Behavioral
- Realizing interactions among different objects
- Concurrency
- Support concurrency aspects
Failure vs Fault vs Error
- Failure: Observable incorrect behavior of SW. it is conceptually related to the behavior of the program rather than its code
- Fault: AKA bug: incorrect piece of code. It is related to the code and is a necessary, but not sufficient condition for the occcurrance of a failure
- Error: cause of a fault usually a human error, can be conceptual, a type-o, or something else
- This is the official IEEE terminology, so you can’t go wrong if you use it
4 mainstream approaches of software verification
- Testing (dynamic verification) - most popular/most used in industry
- Static verification
- Inspections
- Formal proofs of correctness
Today, QA is mostly testing. Bill Gates: “50% of my company employees are testers, and the rest spends 50% of their time testing”
What can testing prove?
It canNOT prove the absense of errors. it can only verify their presence.
Testing granularity levels include unit, integration, system, acceptance, and regression.
Black-box testing
- based on description of the software (specification)
- cover as much specified behavior as possible
- cannot reveal errors due to implementation details
White-box testing
- based on the code
- cover as much coded behavior as possible
- cannot reveal errors due to missing paths
Random testing
Advantages:
- Pick units uniformly
- All inputs considered equal
- Eliminates designer bias (making the same assumption as when we read the specification as when we write the test cases)
- Developer might write code assuming the behavior of the user, and we might write tests making the same assumptions
- Problem is even worse if it’s the same person that develops the code and writes the tests
Problems:
- You’re unlikely to find problems. Bugs are like multiple needles in multiple haystacks. Searching randomly won’t be effective.
Instead, use Partition testing:
- The input domain is naturally split into partitions. Partitions are areas of the domain that are treated homogeneously by the software. Normally, failures tend to be dense in certain partitions.
- So, rather than picking inputs randomly from the entire domain, we want to:
- Identify partitions
- Select inputs from each partition
- By doing these 2 things, we can dramatically increase our chances of finding faults in the code
Boundary values
errors tend to occur at the boundary of a (sub) domain, because they are values that are less understood by developers (e.g. last iteration of a loop, the input 0, etc.)
So, we want to select inputs at these boundaries
- This is complementary to partition testing
- Partition testing identifies the partitions in which we want to select inputs; and boundary testing will help select inputs in these partitions
Category-Partition Method
It is a method of black-box testing for going from the specification (description of the system) to a set of test cases (like any other black box testing approach) by following 6 steps:
- Identify independently testable features
- Identify categories (this is key)
- Partition categories into choices (this is also key)
- Identify constraints among choices
- Produce/evaluate test case specifications
- Generate test cases from test case specifications
Categories are characteristics of each input element. For example, variable str has categories length and content. It’s somewhat subjective in general. Then within each of those, you try to find boundary values.
