This website houses notes from my studies at the University of Liverpool. If you see any errors or issues, please do open an issue on this site's GitHub.
These tools allow us to keep track of changes to code and roll back any part, of any file, to any time in history. Available Tools SVN Git Perforce (Commercial) Documentation This module will look at SVN, the documentation can be found here: https://svnbook.red-bean.com/en/1.7/index.html For documentation on git see here:...
Hello, world! C is also valid C++ code: #include <stdio.h> int main() { printf("Hello World!\n"); } but we can also use C++ features: #include <iostream> int main() { std::cout << "Hello World!" << std::endl; } Header Files We can use C header files in C++ but there are often C++...
The PHP Data Objects (PDO) extension defines an interface for accessing databases in PHP. Connections We create a connection to the database server by creating an instance of the PDO class. We can use the following constructor to this: $pdo = new PDO(dsn, username, password, options); The connection remains open...
C Memory Management So far we have seen: Static-duration Variables (Allocated in Main Memory) Automatic-duration Variables (Allocated on the Stack) There are two issues with these types of variables: The size of the allocation must be compile-time constant. Their persistence cannot be manually controlled. Dynamic Memory Allocation Dynamic memory is...
Orthogonal Testing This is where each range of data (not every combination of data) is tested. We are trying to test only a single attribute at a time. Modes of Error The mode of an error is how many parts of a function have errors in them. Consider that we...
struct struct is a user-defined datatype. It is used to construct complex datatypes from existing ones. struct Syntax struct [struct_tag] { /* member variable 1 */ /* member variable 2 */ /* member variable 3 */ }[struct_variables]; // <-- remember the semicolon struct_tag - The name for the structure (optional)....
Running Time Alternate Method Instead of using the method stated here we can use this easier method instead for: \[T(n) = aT\left(\frac n b\right) + f(n)\] where: \[f(n) = O(n^d)\] We can then use the following cases: \[T(n) = \begin{cases} O(n^d) & \text{if } d>\log_ba\\ O(n^d\log_bn) &\text{if } d=log_ba\\ O(n^{log_ba})...
Testing shows the presence of errors; not their absence. Exhaustive testing is not practical in most cases. Test early and regularly to avoid bug masking and multiple defect relations. Errors are not evenly distributed: 20% of modules generally contain 80% of errors. Pesticide Paradox Unless tests change they often become...
Generating Reports Ant Formatters Ant has three types of formatter for the <junit> task: brief plain xml If we set usefile=true then each test case will generate it’s own file. We can also set printsummary=false if we don’t want this output on the command line. You can also use multiple...
Defining Classes Classes are defined like so: class identifier { property_definitions function_definitions } Function definition may include the definition of a constructor. An object of a class is created using: new identifier(arg1, arg2, ...) The definition of a class typically looks like so: class identifier { # Properties vis $attrib1...