From 64123cb1cb10e210b23146237cab5ee81f9c6311 Mon Sep 17 00:00:00 2001 From: lshprung Date: Tue, 5 Jan 2021 10:07:52 -0800 Subject: First commit --- 01-05.md | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 01-05.md diff --git a/01-05.md b/01-05.md new file mode 100644 index 0000000..6783f60 --- /dev/null +++ b/01-05.md @@ -0,0 +1,115 @@ +# Object-Oriented Programming and Advanced Data Structures + +### Data Structure + +- Why? + - Allows for organizing data, which in turn allows for efficient access to data +- What? + - Various examples (list, stack, queue, tree, graph, etc.) + +### Abstract Data Type vs. Data Structure + +- In computer science, an **abstract data type (ADT)** is a mathematical model for data types + - a data type is defined by its behavior (semantics) from a **user POV** of the data + - specifically in terms of possible values, possible operations on data of this type, and the behavior of these operations + - examples: int, float, etc. +- **Data Structure** is the representation of data from **implementer POV** + +--- + +## Introduction - Phases of Software Development + +### Software Phases + +- Specification of the task +- Design of a solution +- Implementation (coding) of the solution +- Analysis of the solution + - Analyze time and space complexity +- Testing and debugging + - This is arguably the most important phase +- Maintenance and evolution of the system +- Obsolescence + +### Implementation Phase + +1. Design + - Discuss Concept & Design Strategy + - Requirements Analysis + - System Architecture + - Roadmap +2. Develop + - Technical Specification + - App Development +3. Deliver + - Testing + - Delivery & Launch + +--- + +## Testing the Code + +### Program Testing + +- Part of the science of software engineering is the systematic construction of **a set of *good* test inputs that is likely to discover errors** +- GOOD test inputs have two properties: + - Positive verifications: you must know what output a correct program should produce for each test input + - Negative verifications: the test inputs should include those inputs that are most likely to cause errors + +### Testing Methods + +- Boundary Checking + - `int time_check(int hour);` +- Fully Exercised Code + - Make sure that **each line of your code is executed at least once** by some of your test data + - If there is some part of your code that is sometimes skipped altogether, then make sure that **there is at least one test input that actually does skip this part** of your code + +### Testing Stages + +- Unit Testing +- Integration Testing +- System Testing +- Acceptance Testing +- Performance Testing +- Security Testing +- Usability Testing +- Compatibility Testing + +### Example + +- write a test for + +``` +//prerequisite: N <= array1 length +//prerequisite: N <= array2 length +int *add_array(int *array1, int *array2, int N){ + int i; + + for(i = 0; i` + +### Standard Name Space + +- **The Standard Namespace** + - All of the items in the new header files are part of a feature called the **standard namespace**, also called **std** + - When you use one of the new header files, your program should also have this statement after the include directives: `using namespace std;` + - Note: There are other alternatives that we will talk about later -- cgit