• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/90

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

90 Cards in this Set

  • Front
  • Back

What is Software Engineering?

Software Engineering is the “systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software.”

What are the goals (4) of Software Engineering?

Economical
On-Time
High Quality
Meets Needs

How does Software Engineering relates to CS as a whole?

We can apply CS theories and functions, to the tools and techniques of problem solving to get solutions!

What are the different parts of Software Engineering?

Project Management, Software Design, Hardware Considerations, Programming, Software Specification, User Interface Design, User Documentation, Maintenance, Testing.

Why is Software Engineering needed?

Software engineering is necessary to become able to build software on time, on budget, within specification while minimizing defects, managing quality, cost, time, complexity, verifiable, maintainability, availability, reliability, dependability, performance, security, usability, and other attributes of software.

Myths about Software Engineering

MYTHS:
1) More developers = more work done
2) Deliverables ONLY include working project (screw documentation!)
3) More features = better!
4) Once it works, you're done!!!!
5) Quality can only be determined at run-time.
6) outsourcing means you're all done!
7) Software is flexible

What is Version Control?

Managing the change of documents.

Uses for Version Control

Backup & Restore, synchronizing work, track changes, track ownership, sandboxing, branching & merging, short/long-term undo.

Distributed vs Central Version Control

Distributed is faster (other than push/pull), can use without internet (other than push/pull), committing is local, every person has own personal copy, could be sucky for large projects or long history (YuUUUuuGe files).

Mercurial Commands (hg)

init : make repository
add : add files
commit : commit change // -u user, -m message
log : see history
status : current state of files (M, A, C, ?, !, I)
diff : see differences
update : change to specific version/recent
revert : go back to last commit
clone : make local copy
push : put commit into remote repository
pull : get changes

Bill needs to pull the new changes into his repository, merge the changes, commit them and push the changes:

•hg pull


•hg merge


•hg commit


•hg push

What is Issue Tracking?

A database for tracking work that needs to be done on the software


–Text file (2 person)


–Spreadsheet (small team)


–Database-backed system (small to large teams)

What is Issue Tracking used for?

Bug Reports

What are bug reports and who uses them?

A bug report is way to convince a developer to spend time and energy on your problem or feature idea.


Used by: Testers, Managers, Users, Developers, and those mysterious others...

Bug Report Lifecycle

Tester identifies a bug ->


files a bug report ->


Triager prioritize bug ->


developer fixes ->


Tester tests to see if fix worked ->


Bug report updated ->?

Team Roles in Handling Bug Reports

Tester: finds, investigates & reports
Developer: examine & either fixes, estimates, recommends deferring, argues its not a defect
Project Manager: prioritize and reassign
Project Team: reviews deferred defects & re prioritizes
Test Group: retests defects and either closes or sends new info to developers

Ways motivate developers and overcome their objections?

BEER... stroke ego, looks bad, interesting puzzle, affects a lot of users, trivial fix, embarrassment, management says so!

Principles of writing a good bug report

1. Clearly describe steps to reproduce the problem
2. Expected behaviours
3. Actual behaviours

What is Software Testing?

The dynamic verification of the behavior of a program on a finite set of test cases, suitably selected from the usually infinite executions domain, against the expected behavior.

Types of testing

Black-box, white-box, gray-box

What is Black-Box Testing?

Testing of a system without understanding the implementation.

What are black-box testing techniques?

Robustness Testing (values outside of domain) and Ad hoc/Exploratory (based on tester's skills, intuition and experience), equivalence partitioning (selecting the RIGHT test cases to cover all possible scenarios), Boundary value Analysis (choose cases at boundaries).

What is Gray-box Testing?

Testing of functionality, but also looking at how it is done to make sure that is correct also.

What is White-box Testing?

Testing software that tests internal structures or workings of an application, as opposed to its functionality.

What is Unit Testing?

A ‘unit’ is the smallest possible testable item.

What is Test Fixture?

Class containing one or more test methods

What is Test Method?

Method that executes a specific test

What is Test Runner?

Application that finds and executed test methods on

What is Assertion?

A Boolean expressions that describes what must be true when an action execute.

What is UML?

Unified Modelling Language

Visibility Symbols:
+
-
#


~

+ -> Public
- -> Private
# -> Protected
~ -> Package

Three main components of the class in a UML diagram?

Name of the class, attributes, and methods.

What is the difference between “composition” and “aggregation”?

The distinction is subtle, and has to do with if the object would exist after the containing object is destroyed. Composition wouldn't exist, and Aggregation would still exist.

Italics means...?
Arrow means...?

Italics: Abstract class
Arrows: Generalization

What are exceptions?

A situation where something ‘unexpected’ happened during normal execution of program

Examples of Exceptions?

Index out of bounds


Divide by 0


Unexpected input

What are the two types of errors?

Logic errors: internal logic; length, domain, invalid-argument, out_of_range.
Runtime: detected at runtime; range, overflow/underflow, system

When you detect an error.... what you have to do?

THROW AN EXCEPTION!
throw domain_error{“Divisor is 0 in function f()”}

When do exceptions stop being 'thrown up the chain'?

Exception is ‘thrown up the chain’ until either:


Exception is handled


Entire program terminates

Try Catch Block...
Write general case!

try{




}


catch () {




}

Which catch does it go to?

When an exception occurs in a try block, the first catch that matches the exception type is executed.

What is the key idea of inheritance?undefined

You get it from your parents!

Design Principles (5)

•Form consistent abstraction in same class


•Encapsulate implementation details


•Use inheritance to simplify design and reuse code


•Information hiding (complexity hiding)


•Keep coupling loose

What is coupling?

Coupling is the degree of interdependence between software modules; a measure of how closely connected two routines or modules are; the strength of the relationships between modules. Coupling is usually contrasted with cohesion.

ADT and used for?

Abstract Data Types: a collection of data and operations that work on that data (i.e. vector), hides implementation details, easy to change implementation, and works with ABSTRACTION! (not details)

What is Inheritance good for?

Avoiding duplication of code, model relationships, easily extend functionality.

"Has a" ?
"Is a" ?

“Has a”: use containment (i.e. data members)

“Is a”: use inheritance

A is a B...
Who inherits from who?
Who is a subclass, super class, derived class, base class?

A inherits the properties of B.
A is a subclass of B, B is a superclass of A, A is a derived class of B, B is a base class of A.

Chain of calls...

Constructors call Base or Derived first...?
Destructors call Base or Derived first...?

Constructor goes from the Base and goes down to the actual class. Destructors are the opposite.

Employees and Persons have writeInfo();
Employees is a Person.
What do we use to call the Person version and how?

Use SCOPING!!!
Inside the Employee class member function, we can write
Person::writeInfo();

All data members and member functions are automatically inherited by a derived class except for....

Functions which are overriden, constructors, destructors, assignment operators, and friends!

Employee is a subclass of Person. How do we convert?
Person p{"John Doe"};


Employee e{"Joe Blow", 30000};


p = e; OR e = p; ?

p = e; // legal, but you lose information


e = p; // illegal


SoooOOOo, use first one.

Differences between Public, Private, and Protected?

Public: All can use.
Private: Only the class can get access to it.
Protected: Stays in the family.

3 Forms of inheritance?

Specialization: uses public inheritance, adds new specialized attributes and behaviours.

Specification: uses public inheritance, base class specifies some behaviours but does not implement.

Restriction: Only subset of methods in base class used by client, private or protected, least common form.

What is polymorphism?

Means that a call to a member function will cause a different function to be executed depending on the type of object that invokes the function.

Function overloading (static or dynamic)?

STATIC!
Means determined at compile time.

Binding the meaning to the form when the program is run (static or dynamic)?

DYNAMIC BINDING!!!

How is dynamic binding achieved in C++?

Virtual functions

How is a member declared as virtual?

Writing virtual in front of its prototype.

Why polymorphism for functions of same name?

Avoid unnecessary if-thens or switches. Makes the code cleaner and easier to extend! Smells better ;)

True or False: To be safe, destructors of any base class should NOT be called virtual! Only do this when you know what you are doing.

FALSE!
Declaring a destructor virtual makes it possible for the correct destructor to be called by delete. If a class needs to have a destructor, the destructor should probably be a virtual one. To be safe, declare destructors in any base class virtual.

How do we make something an abstract class?

Give it a pure virtual function!

How do we declare a pure virtual function?
Make one for a function draw that is a void type.
Can we implement it in this class?

virtual void draw() = 0;




Technically yes, but for the purpose of this class, NO, the function is not implemented in this class.

Can one declare objects of an abstract class?

NO! One cannot do this. So stop trying!

If a base class is abstract, how can its derived class be normal?

All pure virtual functions must be override!

What is typeid() ?
What do we need to include?

The typeid() operator allows us to get a unique value for each type.


So you can do:


if (typeid(*p1) == typeid(Employee)) { ... }

#include

Dynamic vs Static Casting

Static_cast is used for cases where you basically want to reverse an implicit conversion, with a few restrictions and additions and performs no runtime checks.
Dynamic_cast is used for cases where you don't know what the dynamic type of the object is. You cannot use dynamic_cast if you downcast and the argument type is not polymorphic. If wrong, returns null pointer.

Multiple Inheritance. Does C++ have this?
What does


class A : public B, public C { ... };


really mean?

YES!


class A inherits all members from classes B and C.

A is a B and is a C. B and C have printInfo() .


Let 'a' be of type A.


How do I call B's printInfo?

a.B::printInfo();

SOLID?

S: Single Responsibility Principle
O: Open/Closed Principle
L: Liskov Substitution Principle
I: Interface Segregation Principle
D: Dependency Inversion Principle

What is encapsulation?

Information hiding. The less you know, the better!

What is Single Responsibility Principle

A class should have only a SINGLE responsibility (i.e. ONLY ONE potential change in the software's specification should be able to affect the specification of the class). Delegate!

What is Open/closed principle?

Software entities … should be open for extension, but closed for modification!

What is Liskov substitution principle?

Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program

What is Interface segregation principle?

Many client-specific interfaces are better than one general-purpose interface.

What is Dependency inversion principle?

One should “depend upon abstractions, [not] concretions".

What's the best way to test a design?

Try to change something!!!

Three OO Design Principles?

1. Code to interface, not implementation
2. Encapsulate what varies
3. Each class should only have one reason to change

What is a cohesive class? What's it do?

A cohesive class does one thing really well and does not try to do or be anything else. It has only one reason to change.

What is leading cause of project failure?

Teamwork Problems!

Team Structures

Hierarchical: chief exec -> team leaders -> project members (pyramid!).
Democratic/Open Structured: (whatever)

Phases of Team Development?

Forming: team comes together


Storming: disagreements (teams fail if stuck)


Norming: offering ideas, preferences, contributions


Performing: ideal phase, work hard & play hard

What are these?

What are these?

Aggregation Association.
Aggregation shows a “part of” relationship.

What is this?

What is this?

Composition Association.
Composition also shows a “part of” relationship.

Fill in the blank.

Fill in the blank.

Generalization

Fill in the blanks.

Fill in the blanks.



Whats wrong?

Whats wrong?



What is this?!

What is this?!

Tight coupling with concrete instruments.

What type of version control is this?

What type of version control is this?

Centralized.

What type of version control is this?

What type of version control is this?

Distributed.