# 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 - Namespaces are kind of like classes with a number of defined functions - `::` is the scope resolution ``` functionGlobal(); //functionGlobal belongs to the global namespace A::functionA(); //functionA belongs to namespace A ``` --- [01/07 ->](01-07.md)