diff options
Diffstat (limited to 'dst')
-rw-r--r-- | dst/.files | 5 | ||||
-rw-r--r-- | dst/SPO notes.html | 670 | ||||
-rw-r--r-- | dst/ase.html | 920 | ||||
-rw-r--r-- | dst/game.html | 35 | ||||
-rw-r--r-- | dst/index.html | 28 | ||||
-rw-r--r-- | dst/sitemap.xml | 11 | ||||
-rw-r--r-- | dst/styles/style.css | 91 |
7 files changed, 1760 insertions, 0 deletions
diff --git a/dst/.files b/dst/.files new file mode 100644 index 0000000..cba29fa --- /dev/null +++ b/dst/.files @@ -0,0 +1,5 @@ +./styles/style.css +./SPO notes.md +./game.md +./index.md +./ase.md diff --git a/dst/SPO notes.html b/dst/SPO notes.html new file mode 100644 index 0000000..178a9cb --- /dev/null +++ b/dst/SPO notes.html @@ -0,0 +1,670 @@ +<!DOCTYPE html> +<html> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Exam — adamski.wtf</title> +<link rel="icon" type="image/png" href="favicon.png"> +<link rel="stylesheet" href="styles/style.css"> + +<p class="header"><a href="/">adamski.wtf</a></p> +<h1 id="Exam">Exam</h1> + +<ul> +<li>15 minute video presentation</li> +<li>1 hour to record</li> +<li>Chosen subject appears on digital exam</li> +</ul> + +<h1 id="Language%20processors">Language processors</h1> + +<p>Most important problem in computing : increasing programmer productivity +to improve speed of software release.</p> + +<p>This can be improved with:</p> + +<ul> +<li>Software process (eg: AGIL) about 20% increase</li> +<li>Good tools 10%</li> +<li>Better programming language design immense increase</li> +</ul> + +<p>Example: + Quicksort is twice as much code in C than Haskell</p> + +<p>This can be more readable</p> + +<p>You can gain deeper understanding of programming through learning about compilers.</p> + +<h2 id="Programming%20languages">Programming languages</h2> + +<ul> +<li>Set of rules to tell a computer what operations to perform</li> +<li>For communicating an algorithm</li> +<li>Linguistic framework</li> +<li>Symbols, words, rules of grammar, rules of semantics</li> +</ul> + +<h3 id="Why%20are%20there%20so%20many%20programming%20languages?">Why are there so many programming languages?</h3> + +<p>Programming has evolved over time because different programming languages can be desinged for different types of programs.</p> + +<h3 id="Types%20of%20programming%20languages">Types of programming languages</h3> + +<ul> +<li>Low level - high level 1st-2nd gen</li> +<li>Paradigms + +<ul> +<li>Imperative / object oriented 3rd gen</li> +<li>Logic / declarative (database languages) 4th gen</li> +<li>Functional / logical 5th gen</li> +<li>Reactive programming possible 6th gen?</li> +</ul></li> +</ul> + +<p>We are in the “multi-paradigm era”, Anders Hejlsberg says languages in of the future will be a mix of all existing paradigms.</p> + +<h3 id="What%20is%20a%20good%20language?">What is a good language?</h3> + +<ul> +<li>Formerly: run-time performance</li> +<li>Now: Lifecycle (ease of designing, coding, debugging, maintainance, reusability)</li> +<li>Fads</li> +</ul> + +<p>Programming language characterstics can be broken down into readibility, writability and reliability.</p> + +<p>Static / dynamic typed languages end up with the same amount of time spent debugging. The only difference is where that time is spent.</p> + +<p>Programming languages are languages with no ambiguitity and vagueness. Everything is exact. A sentence means one thing or it means nothing.</p> + +<p>Programming languages require specification. Example: C# docs. Syntax needs to be specified, scope rules, type rules, semantics (or runtime semantics).</p> + +<p>Types of specification: +- Formal: Precise, mathematical +- Informal: description in English +- Usually both</p> + +<p>Language specification consists of: +- Syntax, usually formal +- Contextual constraits + - Scope rules (English / formal) + - Type rules + - Semantics</p> + +<h3 id="Does%20syntax%20matter?">Does syntax matter?</h3> + +<p>Syntax is the visible part of the language. The paradigm is the next most visible. Most invisible part is the language semantics. But clear semantics usually means simple and efficient implementations.</p> + +<p>Yes. Syntax matters. </p> + +<h2 id="Language%20Processors">Language Processors</h2> + +<ul> +<li>Text Editors / IDEs</li> +<li>Translators + +<ul> +<li>Compiler, assembler, disassembler, etc</li> +</ul></li> +<li>Interpreters</li> +</ul> + +<h3 id="Interpreters">Interpreters</h3> + +<p>Take source code and input and produces output. For example, web browser.</p> + +<h3 id="Compilation">Compilation</h3> + +<p>A 2-step process. Source program is inputted to compiler and a new program target program is outputted from the compiler. However this is much more complicated. Lexical-, syntax-, semantic analysis, code generation (IL)?. Sometimes you may generate high-level code. For example, taking source and converting it to C code.</p> + +<p>Phases: +- Syntax analysis -> Error reports | AST +- Contextual analysis -> Error reports | DAST +- Code generation (Semantics) -> Object code</p> + +<p>Symbol tables can be accessed from several phases.</p> + +<h3 id="Compiler%20design">Compiler design</h3> + +<p>Compiler design is strong affected and strong affects programming language design. Advantages of good compiler: easier to learn, read, understand. Fewer bugs. More reliable. More diagnostic messages and tools.</p> + +<p>There are tools to help write compilers (compiler generators/ compiler compiler)</p> + +<ul> +<li>Scanner generators + +<ul> +<li>JLex</li> +</ul></li> +<li>Parser generators + +<ul> +<li>JavaCUP, Yacc</li> +</ul></li> +<li>Front-end generator + +<ul> +<li>SableCC, JavaCC, ANTLR</li> +</ul></li> +<li>Code-generation tools</li> +</ul> + +<h1 id="Programming%20language%20evolution%20and%20tombstone%20diagrams">Programming language evolution and tombstone diagrams</h1> + +<p>Most new languages are invented out of frustration. When a new language is created it tends to be because it would be an improvement over some existing language. For example, Fortran was invented to improve programmer productivity.</p> + +<h2 id="Programming%20language%20design">Programming language design</h2> + +<ol> +<li>Create ideas + +<ul> +<li>Do a problem analysis (what is the purpose?, who is this for?)</li> +<li>Take inspiration from existing languages</li> +<li>Create some example programs</li> +</ul></li> +<li>Describe/define (SS)</li> +<li>Implement (SPO)</li> +<li>Evaluate</li> +<li>Repeat until satisfied</li> +</ol> + +<p>The programming language critera table can be used to generate ideas for or evaluate a language’s design. Reusability and relocatability of code has become a more and more important criteria over time. </p> + +<h2 id="Programming%20language%20history">Programming language history</h2> + +<p>40-50s: Assembly languages made programming more readable more usable. Came with a compiler that could translate assembly to machine operations.</p> + +<p>50s: Fortran was invented, first high-level language. Now programs could be developed machine independant.</p> + +<p>60s: Programming paradigms started taking over. Structured programming. Pascale: No GOTO, Types. OOP.</p> + +<p>70s: C invented for high-level programming with low-level power. Ada invented as a means to avoid using hundreds of different programming languages. Functional programming starts off.</p> + +<p>80s: OOP really takes over. C++ invented (thought of as C with classes). More discussion about functional programming.</p> + +<p>00s: Distributed systems. C# + .Net CLR (common language runtime system).</p> + +<p>10s: Multi-paradigm (OO + FP)</p> + +<h2 id="Tombstone%20diagrams%20-%20gravstens%20diagramer">Tombstone diagrams - gravstens diagramer</h2> + +<p>A notation consisting of puzzle pieces that can be used to reason about language processors and programs.</p> + +<ul> +<li>Program P implemented in language L (tombstone)</li> +<li>Translator implemented in language L (square tombstone)</li> +<li>Machine implemented in hardware M (shield)</li> +<li>Language interpreter in L (square box)</li> +</ul> + +<p>These can be combined to give a general diagram of some source to target language scenario.</p> + +<ul> +<li>Cross compilation: a compiler that runs on one machine, that emits code for another machine.</li> +<li>Two-stage compilation: a composition of two translators. Output of first translator is provided as input to the second. Mainly IL but can be any language.</li> +<li>Interpreters: provide better platform indepedence. Useful for testing and debugging. Typically slower than compilers.</li> +</ul> + +<p>Bootstrapping can be used as a way to generate more efficient compilers.</p> + +<h1 id="The%20ac%20language%20and%20compiler">The ac language and compiler</h1> + +<h2 id="Phases%20of%20a%20compiler">Phases of a compiler</h2> + +<p>Phases: +- Syntax analysis -> Error reports | AST +- Contextual analysis -> Error reports | DAST +- Code generation (Semantics) -> Object code</p> + +<p>The phases can be seen as the transformation steps for transforming some source code into object code.</p> + +<ul> +<li>Syntax analysis <-> Syntax + +<ul> +<li>Lexical analysis <-> Regular Expressions</li> +<li>Parsing <-> CFG</li> +</ul></li> +<li>Contextual analysis <-> Contextual constraints + +<ul> +<li>Scope checking <-> Scope rules (static semantics)</li> +<li>Type checking <-> Type rules (static semantics)</li> +</ul></li> +<li>Code generation <-> Semantics (dynamic semantics)</li> +</ul> + +<p>Modern compilers all make use of symbol tables. This can generally be used in any phase of compilation but it is now best practice to only access it from type checker / contextual analysis.</p> + +<h2 id="Phases%20of%20a%20simple%20compiler">Phases of a simple compiler</h2> + +<ul> +<li>Syntax analysis + +<ul> +<li>Scanner/Lexer -> tokens</li> +<li>Parser: tokens -> AST</li> +</ul></li> +<li>Contextual analysis + +<ul> +<li>Symbol table: AST -> symbol table</li> +<li>Semantic analysis -> DAST</li> +</ul></li> +<li>Code generation + +<ul> +<li>Translation</li> +</ul></li> +</ul> + +<p>Scanner/Lexer phase takes input source code and produces a stream of tokens. Tokens have and type and value.</p> + +<p>Parsing phase is used to determine if the stream of tokens conforms to the languages grammar specification. This phase either produces an AST or returns errors.</p> + +<p>Contextual analysis for checking the semantics. A symbol table is used to process declarations and to check for type consistency.</p> + +<p>Symbol table is generally just a key-value list.</p> + +<p>Type checking: check each node and ensure child nodes are consistent with their types. For example adding an int to a float. The compiler must specificy what to do in this case.</p> + +<p>Code generation: formulation of target-machine instructions that represent the semantics of the source program.</p> + +<h2 id="The%20ac%20language%20(adding%20calculator)">The ac language (adding calculator)</h2> + +<p>A simple language for arithmetic. Monolithic scope, meaning a variable can only be declared once. Target of translation: dc (desk calculator)</p> + +<p>Example ac program:</p> + +<pre><code>f b // float b +i a // int a +a = 5 +b = a + 3.2 +p b // print b +</code></pre> + +<h3 id="Formal%20definition%20of%20ac">Formal definition of ac</h3> + +<ul> +<li>Syntax specification + +<ul> +<li>Context free grammar (CFG)</li> +</ul></li> +<li>Token specification + +<ul> +<li>Regular expressions (RE)</li> +</ul></li> +</ul> + +<h2 id="Context%20free%20grammar%20(CFG)">Context free grammar (CFG)</h2> + +<p>A set of production rules for a language. Two types of symbols: terminals and non-terminals. Terminals cannot be rewritten (id, num, etc). Non-terminals are rules like (prog, scope, etc).</p> + +<p>A syntax tree / parse tree can be used to show the production rules of some source code in a tree structure.</p> + +<h2 id="Regular%20expressions%20(RE)">Regular expressions (RE)</h2> + +<p>For specifying tokens. For example: id, num, “+”, “-”, etc.</p> + +<h1 id="Language%20specifications">Language specifications</h1> + +<p>A communication device between people who need a common understanding of the programming language or PL. For example, the language desinger, implementor, user, etc.</p> + +<p>What should be specified? Syntax, contextual constraints or static semantics (scope/type rules), semantics (runtime semantics).</p> + +<p>How is a language specified? +- Formal: Precise, mathematical +- Informal: description in English +- Usually both</p> + +<p>A language specification needs to address: +- Syntax + - Token grammar: Regular expressions + - Context free grammar: BNF EBNF +- Contextual constraints + - Scope rules (static semantics) + - Often informal + - Type rules (static semantics) + - Informal or formal +- Semantics (dynamic semantics) + - Informal or formal</p> + +<h2 id="Syntax%20terminology">Syntax terminology</h2> + +<ul> +<li>Sentence: string of characters over some alphabet</li> +<li>Language: set of sentences</li> +<li>Lexeme: lowest level syntatic unit of a language</li> +<li>Token: a category of lexemes (e.g. identifier)</li> +</ul> + +<h2 id="Formal%20definition%20of%20languages">Formal definition of languages</h2> + +<ul> +<li>Generators: a device that generates senteces of a language.</li> +<li>Recognizer: reads input strings over the alphabet and decides whether the input strings belong to the language.</li> +</ul> + +<h2 id="Syntax%20specification">Syntax specification</h2> + +<p>Syntax is specified suing a CFG. + - a finite set of terminals (tokens) + - a finite set of non-terminals + - a start symbol + - a finite set of production rules</p> + +<p>Usually CFG are written in BNF notation. Example:</p> + +<pre><code>N ::= a +N ::= a | B | ... +</code></pre> + +<p>Note: non-terminals are often enclosed with angle brackets. Example:</p> + +<pre><code><N> ::= a | <B> | ... +<B> ::= ... +</code></pre> + +<p>In BNF, syntactic lists are described using recursion.</p> + +<h2 id="Derivations">Derivations</h2> + +<p>This is where you take some source code and you step through the CFG with it to see which rules are rewritten to deeper rules, until you get the end result. This can also be represented as a parse tree.</p> + +<p>Leftmost derivation (from left to right) and rightmost derivation (from right to left).</p> + +<p>Leftmost derivation always choses the leftmost possible non-terminal and vice-versa for rightmost derivation.</p> + +<h2 id="Ambiguity%20in%20grammars">Ambiguity in grammars</h2> + +<p>A grammar is ambiguous if a string (sentence) can be defined by more than one different parse trees. Ususally ambiguity is undesirable and CFGs are rewritten to disallow this behaviour. This rewritting process can be done systematically.</p> + +<p>A ‘dangling-else’ problem can be a sign of ambiguity in a language.</p> + +<ul> +<li>Sometimes obvious, sometimes difficult to spot.</li> +<li>Ambiguity in grammars is an undecidable property.</li> +</ul> + +<h2 id="EBNF">EBNF</h2> + +<p>A non-standardised extension to BNF notation.</p> + +<ul> +<li>Optional parts are placed in brackets <a href="sometimes%20question%20mark"></a></li> +<li>Alternatives can be expressed in-line using parentheses ()</li> +<li>Reptitions (0 or more) are placed inside curly braces {} (sometimes parentheses asterisk ()* )</li> +</ul> + +<p>EBNF can also be rewritten to standard BNF fairly easily.</p> + +<h1 id="Context%20free%20grammars">Context free grammars</h1> + +<h2 id="Properties%20of%20grammars%20(non-terminals)">Properties of grammars (non-terminals)</h2> + +<ul> +<li>Left-recursive: <code>N ::= N ...</code></li> +<li>Right-recursive: <code>N ::= ... N</code></li> +<li>Nullable: <code>expression ::= λ</code></li> +<li>Useless: if a non-terminal can never produce a string of terminal symbols.</li> +</ul> + +<h2 id="Grammar%20transformations">Grammar transformations</h2> + +<ul> +<li>Left factorization: <code>X Y | X Z</code> is transformed to <code>X (Y | Z)</code></li> +<li>Elimination of left-recursion: <code>N ::= X | N Y</code> becomes <code>N ::= X Y*</code></li> +<li>Substitution of non-terminals: for clearer CFGs </li> +</ul> + +<h2 id="From%20tokens%20to%20parse%20tree">From tokens to parse tree</h2> + +<p>Parsing is finding the structure in a stream of tokens. This is done by the parser.</p> + +<p>Two well known ways to parse: +- top-down (Leftmost derivation / LL), constructed in pre-order. +- bottom-up (Rightmost derivation in reverse / LR), constructed in post-order.</p> + +<h2 id="First%20sets">First sets</h2> + +<p>The set of all terminal symbols, in order, derived from a sentence S. The empty string λ is never included.</p> + +<h2 id="Follow%20sets">Follow sets</h2> + +<p>The set of terminals that can follow a non-terminal A, where the EOF symbol is $.</p> + +<h2 id="LL(1)%20grammars">LL(1) grammars</h2> + +<ul> +<li>Cannot be left-recursive.</li> +<li>Cannot contain ambiguity.</li> +<li>Some languages have no LL(1) grammar.</li> +<li>λ-free grammars are very easy as you only need to check for the first set.</li> +</ul> + +<h2 id="LR%20grammars">LR grammars</h2> + +<ul> +<li>Can be parsed using an LR algorithm.</li> +<li>Harder to implement parsers for LR than LL.</li> +<li>Can recognize a bigger class of grammars than LL.</li> +<li>LR parsing methods are the most commonly used for automatic tools today.</li> +</ul> + +<h1 id="Lexical%20analysis">Lexical analysis</h1> + +<h2 id="Developing%20a%20scanner">Developing a scanner</h2> + +<p>The scanner/lexer is what reads through source code character by character and divides them into lexemes and tokens. This includes whitespace which can have meaning for languages like Python. </p> + +<p>A Java implementation of a scanner will normally return instances of a Token class, containing a ‘kind’ and ‘spelling’. Some tokens, like floats, ints, etc, have one single spelling so in some cases spelling can be left blank.</p> + +<p>How do we know how to implement a scanner? Read the language specification. Included in the specification is typically tokens/lexemes as regular expressions and reserved words.</p> + +<h3 id="Lexical%20elements">Lexical elements</h3> + +<ul> +<li>Character set (ASCII vs Unicode)</li> +<li>Identifiers</li> +<li>Operators</li> +<li>Keywords</li> +<li>Elementary data</li> +<li>Noise words</li> +<li>Blank space</li> +<li>Layout</li> +<li>Comments</li> +<li>Delimiters</li> +</ul> + +<p>Lexem structure can be more detailed for example allowing escaping characters in strings or allowing a null string. Another example would be 0.1 vs 00.1 or .1, 10. vs 1..10 and so on.</p> + +<p>The audience of your PL matters for lexical design, for example if target audience are C programmers they will prefer curly braces over begin-end keywords. It is a good idea to keep your design simple though. </p> + +<h3 id="Regular%20grammars&#47;expressions">Regular grammars/expressions</h3> + +<p>It is generally better to use regular expressions instead of production rules where possible. Regular expressions are typically easy to implement. REs can be implemented by finite state machines (FSM). These automatas can then be easily implemented in code and as such make the job of implementing a scanner/lexer a little easier. </p> + +<h3 id="Implement%20a%20scanner%20based%20on%20RE%20by%20hand">Implement a scanner based on RE by hand</h3> + +<ol> +<li><p>Express the ‘lexical’ grammar as RE. Sometimes it is easier to start with (E)BNF and do the necessary transformations.</p></li> +<li><p>For each variant use a switch on the first character by peeking the input stream.</p></li> +<li><p>For each repetition (..)* use a while loop that keeps going as look as the peeking input yields an expected character.</p></li> +<li><p>If there are multiple REs then use a switch to determine which rule is being recognized before following steps 2-3. </p></li> +</ol> + +<ul> +<li>Hand-made scanners are easy for simple token arguments but can be hard and error prone for more complicated grammars.</li> +<li>The task can be automated.</li> +<li>Most compilers are developed using a generated scanner.</li> +</ul> + +<h2 id="Generating%20scanners">Generating scanners</h2> + +<p>Something about REs and the different types of FAs are equivalent. +There is an algorithm for transforming NDFA with epsilon into DFAs. DFAs are easily implementable by computers.</p> + +<p>A scanner generator a program that takes tokens as REs and will generate a scanner based on a FAs in whatever language. JLex/Lex/CSharpLex are tools for generating a scanner that recognizes tokens.</p> + +<h2 id="Performance%20considerations">Performance considerations</h2> + +<p>Performance of scanners is important for production compilers. Size of scanner sometimes matters. Note: modern scanners use explicit control, not table, because bigger tables may perform worse on modern architectures.</p> + +<h1 id="Top%20down%20parsing">Top down parsing</h1> + +<p>The job of the syntax analysis, is to read to source text and determine it’s phase structure. +This can be used to construct the AST. The input to the scanner is the stream of characters which output a stream of tokens to the parser or reports errors. The parser produces the AST or reports errors again.</p> + +<p>Top down parsing example of “Micro English”. This is always done with left derivation.</p> + +<pre><code>Sentence Verb Object . +The Noun Verb Object . +The cat Verb Object . +The cat sees a Object . +The cat sees a Noun . +The cat sees a rat +</code></pre> + +<p>This is equivalent to the parse tree that would be produced from the sentence. So Top down is a straight-forward parsing algorithm. The parse structure corresponds to the set of procedures. </p> + +<h2 id="Recursive%20decent%20parsing">Recursive decent parsing</h2> + +<p>Each non-terminal will have a parse method. There will also need to be a method that asks for the next token. This function will either return the this token or give an error in the event of an unexepected token.</p> + +<pre><code>private void parseSentence() { + parseSubject(); + parseVerb(); + parseObject(); + accept('.'); +} +</code></pre> + +<p>This is a little more involved when there are alternatives. This can be implemented using if-elseif or a switch structure that checks for the alternatives.</p> + +<h2 id="Algo%20to%20convert%20EBNF%20into%20a%20RD%20parser">Algo to convert EBNF into a RD parser</h2> + +<p>Foreach non-terminal in the grammar, create a parse method. Parsing a terminal just uses the ‘accept’ method. Parsing of non-terminals is just method calls to those non-terminal’s parse methods in order. If there are repetitions, (0 .. more) you use a while loop. As long as the current token is in the first set, you keep parsing it. Use a switch case of if-else for alternatives. </p> + +<p>For systematic development of a RD parser: 17:36 in video 7. This process is so mechanical that there are tools for doing this. These are known as parser generators. One tool JavaCC is based on LL(k) grammars so you can specify how many symbols it should look at at once. This allows for fine control when parsing. </p> + +<p>If we want the parser to return an AST each of the parse methods should return their little bit of the AST instead of void. (Think of our visitor methods).</p> + +<h2 id="The%20visitor%20pattern%20(briefly)">The visitor pattern (briefly)</h2> + +<p>For OOP the visitor pattern enbales the definition of a new operator on an object structure without changing classes of the objects.</p> + +<h2 id="LL(1)%20grammars-2">LL(1) grammars</h2> + +<p>A grammar which can be parsed with a top-down parse with a lookahead (in the input stream of tokens) of one token.</p> + +<p>Lecture 7 @ 32:00 for formal definition of LL(1) grammar.</p> + +<h3 id="Table-driven%20LL(1)%20parsers">Table-driven LL(1) parsers</h3> + +<p>A table is generated that simulates the way the regular parser’s stack works. This presumably doesn’t consume as much memory as a traditional parser’s stack. The table is constructed with non-terminals and the lookahead terminals. The table tells which rule to use in the grammar. 49:00 Lecture 7. ANTLR an example of a Java parser generator, that allows LL(*) grammars and is table-driven.</p> + +<h1 id="Bottom%20up%20parsing">Bottom up parsing</h1> + +<p>LR languages are more powerful than LL. +- LR(0), SLR(1), LALR(1), LR(k) grammars. +- Can handle left recursion. +- Usually more convenient because less need to rewrite gramamr. +- Most commonly used for parsing methods in automatic tools today.</p> + +<ul> +<li>LR(0): The simplest algorithm.</li> +<li>SLR(1): An improved LR(0).</li> +<li>LR(1): LR(0) with extra lookahead token.</li> +<li>LR(k): for k>0 tokens </li> +<li>LALR: “watered down” version of LR(1)</li> +</ul> + +<p>Read through every construction and recognize it at the end. 13:00 Lecture 8.</p> + +<p>There are tools that can automate generating the bottom up parser. 50:00 Lecture 8.</p> + +<h2 id="Terminology%2015:00%20Lecture%208">Terminology 15:00 Lecture 8</h2> + +<ul> +<li>A reduction transforms <code>uwv to uAv</code> if <code>A -> w</code> is a production.</li> +<li>Right sentenial form.</li> +<li>Handle (informally: a production than can be used in reverse without getting stuck).</li> +</ul> + +<h2 id="The%20shift%20reduce%20process%2018:00%20Lecture%208">The shift reduce process 18:00 Lecture 8</h2> + +<p>This is how bottom up parser work. They have a stack and a table of operations. This can also be represented as a knitting game.</p> + +<p>All bottom up parsers have a similar algorithm: 22:00 Lecture 8 +- A loop with these parts: + - Try to find the leftmost parse tree which has not yet been constructed but all whose children have been constructed. + - This sequence of children is called a handle. + - This sequence of children is built or shifting elements on a stack + - Construct a new parse tree node. + - This is called reducing.</p> + +<p>The only difference in the bottom up algorithms is how they find a handle. +If there is an empty state in the lookup table, we know we have an error.</p> + +<p>How is the parse table built? The table is coded as a DFA (28:00 Lecture 8).</p> + +<h3 id="LR(0)%20conflicts">LR(0) conflicts</h3> + +<p>This algo doesn’t always work. A LR(0) conflict is a situation (DFA state) in which there is more than one possible action for the algo. There are two kinds of conflicts: +- Shift-reduce: can’t decide between shift or reduce. +- Reduce-reduce: can’t decide between two or more reductions for different grammar rules.</p> + +<h3 id="The%20shift-reduce%20problem">The shift-reduce problem</h3> + +<p>This is when you can either shift or reduce. This is a sign that the grammar is not LR(0). +There are tools that can be used to input a grammar and output what kind of grammar it is.</p> + +<h2 id="LR(0)%20vs%20SLR(1)">LR(0) vs SLR(1)</h2> + +<p>SLR(1) looks at the symbol after the handle (follow set). This means fewer reduce-actoins and therefore removes a lot of potential conflicts.</p> + +<h2 id="LR(1)">LR(1)</h2> + +<p>While SLR just uses the follow set for each production. LR(1) looks at the follow set for each handle. This gives even more reductions. LR(1) parse tables are very big. Expensive but almost all common languages are LR(1).</p> + +<h2 id="LALR(1)">LALR(1)</h2> + +<p>A variant of LR(1) that gives smaller parse tables. This is done by combining some states in the parse tree. In practice most practical languages are LALR(1).</p> + +<h2 id="Parser%20conflict%20resolution">Parser conflict resolution</h2> + +<p>Parsing conflicts are commonly caused by ambiguous grammars. In practice, these ambiguities are solved using a resolution rule however this may or may not do what you want (fx: dangling-else).</p> + +<p>Parsing conflicts must be fixed. You cannot rely on the resolution rule.</p> + +<h1 id="Abstract%20syntax%20trees%20(AST)">Abstract syntax trees (AST)</h1> + +<p>Like a parse tree but with some details omitted.</p> + +<p>Semantic actions and values 5:00 Lecture 9. +Synthesized and inherited attributes.</p> + +<p>AST must be concise and sufficiently flexible. AST is typically constructed bottom up. Lists of siblings are typically generated by recursive rules.</p> + +<p>It should be possible to unparse an AST (reconstruct the source from an AST).</p> + +<h2 id="Single-pass%20vs%20multi-pass%20compilers">Single-pass vs multi-pass compilers</h2> + +<p>Single-pass makes a single pass over source text, parsing, analyzing, and generating code all at once. This means that the contextual analyzer and code generator are called from the parser implementation.</p> + +<p>Multi-pass makes several passes over the program. This is the modern approach. The output of a preceeding phase is stored in a data structure and used by subsequent phases. This is more readable and maintainable as the code is more broken down into independant modules.</p> + +<h2 id="Visitor%20pattern">Visitor pattern</h2> + +<p>35:00 Lecture 9. </p> + +<h2 id="Contextual%20analysis">Contextual analysis</h2> + +<p>Identification and type checking are combined into a depth-first traversal of the AST.</p> +<p class="footer"><a href="/">adamski.wtf</a></p> +</html> diff --git a/dst/ase.html b/dst/ase.html new file mode 100644 index 0000000..9d6df59 --- /dev/null +++ b/dst/ase.html @@ -0,0 +1,920 @@ +<!DOCTYPE html> +<html> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Q1. Software Process Model - Waterfall — adamski.wtf</title> +<link rel="icon" type="image/png" href="favicon.png"> +<link rel="stylesheet" href="styles/style.css"> + +<p class="header"><a href="/">adamski.wtf</a></p> +<h1 id="Q1.%20Software%20Process%20Model%20-%20Waterfall">Q1. Software Process Model - Waterfall</h1> + +<h2 id="What%20is%20software%20engineering%20a%20response%20to?">What is software engineering a response to?</h2> + +<ul> +<li>Increasing system complexity.</li> +<li>Failure to use software engineering methods.</li> +</ul> + +<p>There are no universal notations, methods or techniques for software engineering. +This is because different types of software require different approaches.</p> + +<p>There are cases where software projects or software can fail.</p> + +<h3 id="Increasing%20system%20complexity">Increasing system complexity</h3> + +<p>As new software technology helps us to build bigger, more complicated systems, the requirements change.</p> + +<p>Systems need to be developed and delivered faster meaning more complicated systems are required. +This means more requirements for the systems.</p> + +<h3 id="Failure%20to%20use%20software%20engineering%20methods">Failure to use software engineering methods</h3> + +<p>It is easy to develop programs without using software engineering techniques… BUT +This can result in more expensive software development and less reliable, readable systems. +To solve this issue, more education and training is required on these techniques.</p> + +<h2 id="Software%20engineering%20process%20activities">Software engineering process activities</h2> + +<h3 id="Software%20specification">Software specification</h3> + +<p>This is where the clients and the developers define the software that should be produced. +This is where the software is limited in terms of what is should be.</p> + +<h3 id="Software%20development">Software development</h3> + +<p>This is where the software is designed and programmed.</p> + +<h3 id="Software%20validation">Software validation</h3> + +<p>This step ensures that the software does what the client requested.</p> + +<h3 id="Software%20evolution">Software evolution</h3> + +<p>When software is modified to meet client’s or the market’s new requirements.</p> + +<h2 id="What%20is%20a%20software%20process%20model">What is a software process model</h2> + +<p>A software process model is a set or related activities that leads to a software product. +An abstract descriptions of high level software processes. +These can be used to explain different approaches to software development. +These can be interpreted as frameworks that can be expanded and personalized to create more specific software engineering processes.</p> + +<h3 id="Waterfall%20model">Waterfall model</h3> + +<p>The model takes the fundamental software process activities. +Seperate process phases: +- Requirement specification +- Software design +- Implementation +- Test</p> + +<h3 id="Incremental&#47;iterative%20development">Incremental/iterative development</h3> + +<p>This approach combines the activities with specification, development and validation. +The system is developed in a series of versions (increments) +Each version adds some functionality on top of the previous version.</p> + +<h3 id="Integration%20and%20configuration">Integration and configuration</h3> + +<p>This approach depends on the availability of reusable components or systems. +The systemdevelopment process focuses on configuring these components to be used in new contexts and integrate them with the system. +This lets you reuse code from previous projects and save time and money.</p> + +<h2 id="Waterfall%20model-2">Waterfall model</h2> + +<p>Activities are done in a sequence. +Handover of workproducts between phases and milestones are used to monitor progress. +Waterfall model is an example of a plan-driven process. +You are supposed to have all of the process activities and phases planned out before you start development. +The phases in the model directly reflect the fundamental development activities.</p> + +<h3 id="Requirements%20analysis%20and%20definition">Requirements analysis and definition</h3> + +<p>The systems services, limits and goal and made concrete through consulting with the users. +They are then defined in detail and are used as the system specification.</p> + +<h3 id="System%20and%20software%20design">System and software design</h3> + +<p>The overall system architecture is established in this phase. +Identify and describe the fundamental system abstractions and their relations (UML)</p> + +<h3 id="Implementation%20and%20unit%20testing">Implementation and unit testing</h3> + +<p>The design is implemented in the indivivual program parts. +The design is tested to verify that it meets the specification.</p> + +<h3 id="Integration%20and%20system%20testing">Integration and system testing</h3> + +<p>The individual program parts are integrated and the whole system it tested. +The software is delivered to the client.</p> + +<h3 id="Operation%20and%20maintenance">Operation and maintenance</h3> + +<p>The system is now installed and in use. +The system is maintained to any issuse that weren’t found earlier. +The system is improved over time.</p> + +<h2 id="When%20should%20you%20consider%20using%20waterfall?">When should you consider using waterfall?</h2> + +<p>For software that needs to be flexible while it is being developed.</p> + +<h3 id="Embedded%20systems">Embedded systems</h3> + +<p>The software must interface with hardware. +In this case the hardware is not flexible, thus the software must be.</p> + +<h3 id="Critical%20systems">Critical systems</h3> + +<p>When total security is a requirement of the specification and design. +These systems must have finite specifications and design documents.</p> + +<h3 id="Large%20software%20systems">Large software systems</h3> + +<p>Part of a larger system being developed by several parties. +This makes finite specifications extremely necessary.</p> + +<h2 id="How%20can%20I%20decide%20on%20waterfall?%20-%20analyse%20home%20ground">How can I decide on waterfall? - analyse home ground</h2> + +<p>When one phase ends another begins. +Steps come ordered and don’t allow for going back and redoing parts. (waterfall flows only down) +When the requirements are mostly unchanging.</p> + +<h3 id="Plan%20driven%20versus%20agile%20processes?">Plan driven versus agile processes?</h3> + +<p>Activities in sequence versus all activities at the same time. +Agile development is very flexible and the requirements may be constantly changing. </p> + +<h2 id="Incremental%20model">Incremental model</h2> + +<p>You can iterate within increments and the increments can be planned. +You work within fixed time slots and update the project backlog continuously. +Incremental is an agile process, where you end with multiple versions that you can show the clients as the project progresses. +This allows for the client to come with feedback along the way.</p> + +<h2 id="Integration%20and%20configuration-2">Integration and configuration</h2> + +<p>Development risk is reduced by reuse but there is the risk of not being able to make the desired changes at all or in the time frame. +Most projects have some level of code reuse. +This is often informal. +This reuse requires looking for the existing code, changing them to meet the requirements and integrating them with the new code.</p> + +<h1 id="Q2.%20Software%20Process%20Model%20-%20Incremental&#47;iterative">Q2. Software Process Model - Incremental/iterative</h1> + +<p>The incremental development is based on the idea that: +1. Develop in prototypes. +2. Get feedback from the users and others. +3. Develop over multiple versions until the required system is produced.</p> + +<p>Incremental development is the most common approach to developing applications and software. </p> + +<h2 id="Can%20it%20be%20both%20plandriven%20and%20agile?">Can it be both plandriven and agile?</h2> + +<p>Yes, it can be either one or a mix of both.</p> + +<h3 id="Plan-driven%20approach">Plan-driven approach</h3> + +<p>Identify the system increments in advance. +A predictable waterfall plan is split into parts.</p> + +<h3 id="Agile%20approach">Agile approach</h3> + +<p>The early increments are identified. +The later increments depend on progress and the clients priorities. +You work in fixed timeframes and update the full project backlog as you go.</p> + +<h3 id="Agile-manifest%20(balance&#47;mix)">Agile-manifest (balance/mix)</h3> + +<p>Focus on the individuals and teamwork rather than the processes and tools. +Good software comes before comprehensive documentation. +Work with the client instead of using contract work. +Deal with changes instead of sticking to the plan.</p> + +<h2 id="What%20are%20advantages%20of%20incremental?">What are advantages of incremental?</h2> + +<ol> +<li><p>Development costs are reduced +The amount of analysis and documentation that has to be redone is much less than waterfall.</p></li> +<li><p>It is easier to get client feedback +The clients can comment on demonstrations of the different versions and see the progress.</p></li> +<li><p>Earlier delivery of new software +New features can be made available even if they are not fully completed.</p></li> +</ol> + +<h2 id="What%20disadvantages%20are%20there?">What disadvantages are there?</h2> + +<ol> +<li><p>The project is not visible +Managers can have difficulty measuring progress. +It would be a waste of resources to produce documents that reflect the different versions.</p></li> +<li><p>The system structure can get messy over time +Changes lead to messy code. +It gets increasingly difficult to add new functions to a system. +Large, complex systems with large teams struggle with incremental for this reason. +Large systems need a stable architecture. +Responsibility of the different teams needs to be clear with respect to this architecture. +This has to be done in advance.</p></li> +</ol> + +<h1 id="Q3.%20Software%20Process%20Model%20-%20Integration%20and%20configuration">Q3. Software Process Model - Integration and configuration</h1> + +<h2 id="What%20are%20the%20phases?">What are the phases?</h2> + +<h3 id="Requirements%20specification">Requirements specification</h3> + +<p>The inital requirements are suggested +They don’t need to be developed in more detail. +They should include short descriptions of important requirements and desired functionality.</p> + +<h3 id="Software%20discovery%20and%20evaluation">Software discovery and evaluation</h3> + +<p>With the overview of the requirements, components are searched for that provide the necessary functionality.</p> + +<h3 id="Requirements%20refinement">Requirements refinement</h3> + +<p>The requirements are polished with the knowledge of the reusable components that were found.</p> + +<h3 id="Application%20system%20configuration">Application system configuration</h3> + +<p>If an application that meets the requirements is available, it is configured for use in the new system.</p> + +<h2 id="Advantages&#47;disadvantages">Advantages/disadvantages</h2> + +<p>This model reduces the amount of software that must be developed. +This in turn, reduces the costs and risks.</p> + +<p>You usually don’t have control of the software that is being reused. +This can include for example how and when new version are released and how the functionality is changed.</p> + +<h1 id="Q4.%20Comparison%20of%20plandriven%20and%20agile%20including%20Homeground">Q4. Comparison of plandriven and agile including Homeground</h1> + +<h2 id="What%20is%20the%20difference%20between%20plandriven%20and%20agile?">What is the difference between plandriven and agile?</h2> + +<h3 id="Plandriven">Plandriven</h3> + +<p>Plandriven means the desired result can be predicted. +Plandriven = waterfall. +Plandriven is an approach where the development process is planned in detail. +A project plan is created that registers the work that needs to done, who should do it the development plan and the work tools. +Managers use this plan to support project decisions and as a way to measure progress. +This is a traditional approach to software development.</p> + +<h3 id="Agile">Agile</h3> + +<p>Agile expects changes and frequent user inspection to get the best results. +Agile = Iterative, more detailed Scrum and XP +Agile methods are iterative, the software is developed and delivered in stages. +These versions are not planned in advance but are chosen underway. +Decisions on what should be included in a version depend on the clients priorities.</p> + +<h2 id="How%20does%20B%C3%B6hm&#47;Turner%20define%20primary%20factors?">How does Böhm/Turner define primary factors?</h2> + +<h3 id="Application">Application</h3> + +<h4 id="Agile-2">Agile</h4> + +<p>Goal: to handle changes in the project. +Small teams. +Environment is turbulent and fast-paced, project focused.</p> + +<h4 id="Plandriven-2">Plandriven</h4> + +<p>Goal: predictability, stability and security. +Larger teams and projects. +Environment: stable, few changes, organisation focused.</p> + +<h3 id="Management%20(onsite,%20qualitative%20control,%20tacit%20knowledge)">Management (onsite, qualitative control, tacit knowledge)</h3> + +<h4 id="Agile-3">Agile</h4> + +<p>Customer relations: dedicated clients on site, focused on prioritised changes +Planning and control: qualitative control. Who and how doensn’t matter as long as it gets done. +Communications: Tacit knowledge. People do things without needing much explanation or discussion.</p> + +<h4 id="Plan-driven">Plan-driven</h4> + +<p>Customer relations: More formal and infrequent. Focused on contract decisions. +Planning and control: Documented plans, quantitative control. It is important to know who does what. +Communications: Explicit. Plans must be discussed and verbalized and shared with the others.</p> + +<h3 id="Technical">Technical</h3> + +<h4 id="Agile-4">Agile</h4> + +<p>Requirements: can withstand unpredictability. +Development: simple design, small increments, refactoring is assumed to be cheap. +Test: Test cases define the requirements.</p> + +<h4 id="Plan-driven-2">Plan-driven</h4> + +<p>Requirements: Formal project, user interface, quality, predictable requirements. +Development: Comprehensive design, larger intervals, refactoring is costly. +Test: Documented testplans and procedures.</p> + +<h3 id="People">People</h3> + +<p>Cockburn characteristics can describe a programmers personality. +One type may be more favourable than another depending on agile/plan-driven approach. </p> + +<h2 id="5%20axis%20on%20the%20Home%20Ground%20Decision%20tool">5 axis on the Home Ground Decision tool</h2> + +<ul> +<li>Criticality: impact of defects</li> +<li>Personell: average cockburn type</li> +<li>Dynamism: % requirement change per month</li> +<li>Culture: % thriving on chaos vs. order</li> +<li>Size: # of personnel</li> +</ul> + +<h2 id="What%20is%20continuous%20integration%20and%20how%20does%20it%20relate%20to%20agile?">What is continuous integration and how does it relate to agile?</h2> + +<p>As soon as the work on a task is complete, it is integrated into the whole system. +After such integration, all the unit tests must pass. +Continuous integration uses tools to automate the process. +Depends on unit tests. +Does NOT remove the need for tests.</p> + +<h2 id="Prototype%20development">Prototype development</h2> + +<ul> +<li>Prototype plan: establish objectives</li> +<li>Outline definition: define functionality</li> +<li>Executable prototype</li> +<li>Evaluation report</li> +</ul> + +<h1 id="Q5.%20Key%20features%20of%20SCRUM">Q5. Key features of SCRUM</h1> + +<p>Openness of all work. +Respect each other. +Focus on the common goal. +Courage for difficult decisions. +Duty to the common goal.</p> + +<p>3 roles. +5 events. +3 artifacts.</p> + +<h2 id="Assets">Assets</h2> + +<ul> +<li>Scrum board</li> +<li>Project burndown</li> +<li>Sprint burndown</li> +</ul> + +<h2 id="Three%20pillars">Three pillars</h2> + +<p>Transparency: Everyone knows what needs to be done and who is doing what. +Inspect: Keep an eye on where we are heading (daily meetings). +Adapt: Change if it is necessary.</p> + +<h2 id="Core%20values">Core values</h2> + +<p>Commitment: to reach the sprint goal. +Focus: on what needs to be done in the sprint. +Openness: Communication is key, don’t hide issuse. +Respect: for each other +Courage: to do the right thing</p> + +<h2 id="Typical%20errors">Typical errors</h2> + +<p>Scrum master is a manager. +No communication with the client. +New tasks are added to the sprint backlog in the middle of a sprint.</p> + +<h2 id="Daily%20SCRUM">Daily SCRUM</h2> + +<p>Inspect progress towards the sprint goal. +Adjust the backlog accordingly. +Update (how far are we?) +Short meeting (15 min) +Tell the others if you need help.</p> + +<h2 id="Sprint%20planning">Sprint planning</h2> + +<p>Work together with the whole SCRUM team for sprints. +Look in the backlog. +Make a sprint backlog. (this can’t be changed from the outside)</p> + +<h2 id="Sprint%20review">Sprint review</h2> + +<p>Check development status. +Sprint review max 4 hours with sprints of 4 weeks. +The client participates along with the team. +Only talk about what has been done. +Dialogue, no presentation. +Update the backlog.</p> + +<h2 id="Sprint%20retrospective">Sprint retrospective</h2> + +<p>For increasing quality and effictivity. +What went well/bad? +How can this be improved for the future?</p> + +<h2 id="Roles">Roles</h2> + +<h3 id="Product%20owner">Product owner</h3> + +<p>Stakeholder contact +Updates/prioritises the product backlog +Can be a person dedicated to the client +The goal is the maximise product value +Can delegate but is responsible</p> + +<h3 id="SCRUM%20master">SCRUM master</h3> + +<p>Ensure everyone is keeping in-line with SCRUM +Not the management leader +Ensure the team is effective +Deal with the teams blockages</p> + +<h3 id="Developers">Developers</h3> + +<p>They own the backlog +Programmers, UI, UX and so on</p> + +<h1 id="Q6.%20Key%20features%20of%20XP%20-%20eXtreme%20Programming">Q6. Key features of XP - eXtreme Programming</h1> + +<h2 id="What%20is%20XP?">What is XP?</h2> + +<p>An agile, incremental development method with focus on: +- Collaboration +- Quick and early software creation +- Skillfull development practices +XP takes all the ‘good things’ the extreme. (testing, pair programming).</p> + +<p>The customre should be available full time for the use of the XP team. +In XP, the customer is a member of the dev team and is responsible for bringing requirements.</p> + +<p>Pair programming: developers work in pairs, checking each other’s work to ensure quality.</p> + +<h2 id="Qualities%20of%20XP%20that%20fit%20to%20SCRUM">Qualities of XP that fit to SCRUM</h2> + +<p>Pair-programming. +Writing unittests before the code (with the help of TDD). +Partners often have to integrate their code (use continuous integration). +Refactor as often as possible. +Collective ownership of code. +Customer on-site, user stories, planning game, …</p> + +<h3 id="What%20does%20XP%20and%20SCRUM%20have%20in%20common?">What does XP and SCRUM have in common?</h3> + +<p>Work should be done incrementally/iteratively. +Teamwork, transparency, communication and prioritisation are crucial. +Requirements are broken down into bite-size pieces. +There is overlap with the roles. (XP client and SCRUM’s product owner)</p> + +<h2 id="What%20values%20are%20XP%20based%20on%20according%20to%20Larman?">What values are XP based on according to Larman?</h2> + +<p>Communication, simplicity, feedback, courage.</p> + +<h3 id="Communication">Communication</h3> + +<p>Pair programming +Customer on-site +Acceptance test +Daily standup (short meetings)</p> + +<h3 id="Simplicity">Simplicity</h3> + +<p>Teams implement exactly what was asked for. Nothing more. +Strive for simple designs and quality code.</p> + +<h3 id="Feedback">Feedback</h3> + +<p>Early and frequent feedback is crucial. +Feedback can come from unittests, team members and the client. +Continuous integration. +Acceptance test that the client performs. +Short sprints.</p> + +<h3 id="Courage">Courage</h3> + +<p>Developers should be honest. +Don’t make excuses for issuse. +Don’t be afraid to make big changes.</p> + +<h2 id="How%20is%20XP%20extreme?">How is XP extreme?</h2> + +<p>E.g. If tests are good, do them all the time. +Takes all good things, and places them at the core of the process.</p> + +<h2 id="Name%20some%20key%20practices%20in%20XP?">Name some key practices in XP?</h2> + +<p>Unit test, pair review, customer on-site, continuous integration, testing, early test, unit test, TDD.</p> + +<h2 id="What%20is%20a%20user%20story?">What is a user story?</h2> + +<p>Brief feature request, a promise for conversation. +Written on a card with criteria for confirmation on the back.</p> + +<h2 id="Story%20maps%20-%20User%20story%20mapping">Story maps - User story mapping</h2> + +<p>To see the bigger picture of the user stories. +To understand how things are now and to imagine how they could be. +Visualize the stories you tell about your software.</p> + +<p>Story maps consist of: +* User + - a card that tells a story about a type of person, doing something to reach a goal. +* Activities + - Jobs done by similar people to reach a time +* Backbone + - Activies and jobs on a higher goal tier, give the user story structure. + - This is a big goal, that the little goals are attached to. +* User tasks + - Short, concise sentences that explain the goal. +* Sub-tasks + - Break down more complicated goals. +* Release slices + - Identify tasks. The smallest number of tasks that allow specific users to reach their goal.</p> + +<p>Story map process has 4 levels</p> + +<h2 id="What%20is%20the%20format%20a%20user%20story?">What is the format a user story?</h2> + +<p>“As a <user> I want <feature> so that <why>”. +Who, what, why.</p> + +<h2 id="How%20does%20XP%20describe%20Lifecycle%20for%20a%20System?">How does XP describe Lifecycle for a System?</h2> + +<p>Exploration, planning, iterations to first release, productionizing, maintenance.</p> + +<h2 id="What%20is%20the%20iteration%20called%20in%20XP?">What is the iteration called in XP?</h2> + +<p>Iteration</p> + +<h1 id="Q7.%20Product%20Planning:%20Requirements%20Elicitation,%20Product%20Vision,%20Product%20Roadmap">Q7. Product Planning: Requirements Elicitation, Product Vision, Product Roadmap</h1> + +<h2 id="What%20main%20requirement%20activities%20are%20there?">What main requirement activities are there?</h2> + +<p>Elicitation and analysis of needs. +Specification of requirements. +Validation of requirements.</p> + +<h2 id="Elicitation%20and%20analysis%20of%20needs">Elicitation and analysis of needs</h2> + +<p>There are two fundamental approaches to Requirement Elicitation: +1. Interview, where people talk about what they are doing. +2. Observation or etnography, where you observe how people do their work and which technologies they use and so on.</p> + +<p>Use a mix of interview and observation to gather information. +This can be used to find the requirements that form the basis of further discussion.</p> + +<h2 id="Requirement%20specification">Requirement specification</h2> + +<p>Is a process in which you write down user and system requirements into a document. +Ideally, these requirements should be clear, consistent, complete and easy to understand. +User requirements should be written in natural language and supplemented with dialogue and tables in the document. +System requirements can also be written in natural language, but other notations, graphs, maths, etc can also be used. (state machines, automata)</p> + +<h2 id="Requirement%20validation">Requirement validation</h2> + +<p>Is the process of controlling of ensuring that the system requirements will are really what the client wants. +There are different checks that can be used to validate the requirements.</p> + +<ol> +<li><p>Validity checks: +Check if the requirements reflect the users real needs. +User needs can change over time, so this is an important thing to keep track of.</p></li> +<li><p>Consistency checks: +Requirements should not conflict with others. </p></li> +<li><p>Completeness checks: +The requirement specification should be comprehensive for every function and the limits that the client wants.</p></li> +<li><p>Realism checks: +Using knowledge on existing systems, control the requirements to ensure that they fit within the budget and time-frame.</p></li> +<li><p>Verifiability: +You should be able to create tests that verify whether or not a requirement is met.</p></li> +</ol> + +<h2 id="Requirement%20validation%20techniques">Requirement validation techniques</h2> + +<ol> +<li><p>Requirement reviews +Requirements are analyzed systematically by a team of judges, to check for mistakes or conflicts.</p></li> +<li><p>Prototyping +Develop executable models of the system and verify with the client that it meets their expectations.</p></li> +<li><p>Test-case generation +Tests can be designed along with requirements instead of after the fact. +If it is difficult to design tests for a requirement, that can mean the requirement is unrealistic.</p></li> +</ol> + +<h2 id="What%20are%20the%20steps%20in%20elicitation?">What are the steps in elicitation?</h2> + +<ol> +<li><p>Discovery & Classification +This is the process of interacting with the stakeholders to find their requirements.</p></li> +<li><p>Categorization +Take the unstructured list of requirements and group related requirements together.</p></li> +<li><p>Prioritization & Negotiation +Conflicts can arise when there are multiple stakeholders. +Prioritize the most important requirements, through negotiation, discussions, compromises and meetings.</p></li> +<li><p>Documentation +Here the requirements are documented.</p></li> +</ol> + +<h2 id="Why%20is%20it%20difficult%20to%20elicit%20requirements?">Why is it difficult to elicit requirements?</h2> + +<p>Many stakeholders with conflicting needs. +Stakeholders speak their own “language”. +Lack of communication because things are assumed to be “obvious”.</p> + +<h2 id="What%20is%20a%20recognized%20way%20to%20communicate%20requirements?">What is a recognized way to communicate requirements?</h2> + +<p>Stories, Scenarios.</p> + +<h2 id="How%20are%20requirements%20documented%20in%20Waterfall%20and%20in%20SCRUM,%20in%20Product%20Planning?">How are requirements documented in Waterfall and in SCRUM, in Product Planning?</h2> + +<p>Waterfall: Verify the requirement specificatino with strict change management. +SCRUM: Product vision and product backlog, are discussed and updated every sprint. +Product Planning: Product vision, release plans and/or product roadmaps. +XP: User Stories.</p> + +<h2 id="How%20are%20requirements%20negotiated%20with%20stakeholders%20in%20Waterfall%20and%20SCRUM?">How are requirements negotiated with stakeholders in Waterfall and SCRUM?</h2> + +<p>Waterfall: Be up front in the requirements phase - state it now or it will be difficult later on. +SCRUM: Ongoing refinement of product backlog with stakeholders, say what is most important now, we will continue. +XP: Customer on-site.</p> + +<h1 id="Q8.%20Product%20Refinement%20and%20Forecasting:%20User%20story%20mapping,%20personas,%20stakeholders,%20product%20backlog">Q8. Product Refinement and Forecasting: User story mapping, personas, stakeholders, product backlog</h1> + +<h2 id="What%20is%20a%20persona?">What is a persona?</h2> + +<p>User personas are a useful technique to describe users of your product. +A fictional character with a name, picture, relevant characteristics, behavior, opinions and a goal. +Different people can have different goals. +Understand a personas goal is useful for creating a product that is meaningful to the users.</p> + +<h2 id="What%20is%20a%20user%20story?-2">What is a user story?</h2> + +<p>Short description on a type of user, a goal and a reason.</p> + +<h2 id="Where%20do%20we%20use%20the%20terms:%20Product%20Feature,%20Epic,%20User%20story?">Where do we use the terms: Product Feature, Epic, User story?</h2> + +<p>Product Feature: Corresponds to an Epic. +Epic: A collection of related user stories. +User story: Breakdown of an Epic. </p> + +<h2 id="What%20is%20a%20user%20journey?">What is a user journey?</h2> + +<p>The experiences a person has, when interacting with the software.</p> + +<h2 id="What%20are%20the%20key%20characteristics%20of%20a%20product%20backlog?">What are the key characteristics of a product backlog?</h2> + +<p>This is to do list of items a SCRUM team must tackle. +- Software requirements. +- User stories. +- Descriptions of supplementary tasks that are needed, such as architecture definition or user documentation.</p> + +<h1 id="Q9.%20Risk%20Management">Q9. Risk Management</h1> + +<p>A risk is a potential problem. +The possibility of loss or damage. +Risk Management: project leaders must evaluate the risks that can affect a project, monitor them, and handle them when problems arrise.</p> + +<h2 id="Example%20of%20risk%20categories">Example of risk categories</h2> + +<ol> +<li>Uncertainty, project, technical, business.</li> +<li>Keyperson from team dies, a supplier is not delivering as promissed.</li> +</ol> + +<h2 id="Categories%20of%20risk">Categories of risk</h2> + +<h3 id="Project%20risks">Project risks</h3> + +<p>Risks that threaten the project plan. +Time will be wasted and costs will rise.</p> + +<h3 id="Technical%20risks">Technical risks</h3> + +<p>Architectural design. +Arrises because problems can be harder to solve than expected. +Vagueness in the specification. +Project gets older and starts to decay.</p> + +<h3 id="Business%20risks">Business risks</h3> + +<p>Market risk. What if no one uses the product? +Strategic risk. We don’t need that new component after all. +Sales risk. How the fuck do we sell this?! +Management risk. The top management don’t support the project anymore. +Budget risks. Budget or personnel is lost.</p> + +<h2 id="How%20do%20you%20do%20risk%20analysis?">How do you do risk analysis?</h2> + +<p>Risk analysis and management are actions, that help a software team understand and handle uncertainty. +It is a good idea to identify risks. +Evaluate the probability of risks. +Estimate the impact of a risk and form a reaction plan for if the risk actually happens.</p> + +<h2 id="Identify%20risks%20and%20calculate%20risk%20exposure%20and%20describe%20consequence.">Identify risks and calculate risk exposure and describe consequence.</h2> + +<p>Risk exposure = probability * loss, describe consequence. +Probability < 100%. If p = 100% then it’s an issue.</p> + +<p>Prioritize according to risk exposure, establish cut-line. +Deal with the risks above the line, accept the ones below.</p> + +<p>Establish for each risk above the cut-line (RMMM: Risk Mitigation, monitor, management)</p> + +<h3 id="Mitigate">Mitigate</h3> + +<p>We want to prevent the risk from becoming an issue. +We can reduce the probability. +Or try to reduce the associated loss. +Risk exposure = probability * loss.</p> + +<h3 id="Manage">Manage</h3> + +<p>For when a risk has become a loss, try to minimize the loss. +This assumes the mitigation activity was unsuccessful. +This is done by the project leader.</p> + +<h3 id="Monitor">Monitor</h3> + +<p>Observe how risks change over time. +How the probabilities, loss, or the environment, change over time.</p> + +<h2 id="How%20are%20risk%20management%20part%20of%20project%20management">How are risk management part of project management</h2> + +<h3 id="Waterfall%20&#47;%20plan-driven">Waterfall / plan-driven</h3> + +<p>Risk and risk plans are part of the plans in project management. +Development of others plans to contribute to identification of risk. +It is planned.</p> + +<h3 id="Agile%20-%20inspect%20and%20adapt%20is%20reduction%20to%20produce%20the%20right%20product">Agile - inspect and adapt is reduction to produce the right product</h3> + +<p>Daily SCRUM: Do you have any impediments? +Sprint review: Inspects risk related to product and stakeholder. +Sprint retrospective: Adresses risks related to how the team works.</p> + +<h2 id="What%20are%20B%C3%B6hms%20primary%20risks?">What are Böhms primary risks?</h2> + +<p>Personal shortcomings, unrealistic schedule, wrong function…</p> + +<h1 id="Q10.%20How%20is%20quality%20defined?">Q10. How is quality defined?</h1> + +<h2 id="Software%20quality%20attributes">Software quality attributes</h2> + +<h3 id="Nonfunctional%20requirements">Nonfunctional requirements</h3> + +<p>Safety, security, reliability, complexity, adaptability, testability, understandability, efficiency, usability, etc…</p> + +<h3 id="Functional%20requirements">Functional requirements</h3> + +<ul> +<li>Requirement Specification (waterfall)</li> +<li>Product backlog and User Stories (agile)</li> +</ul> + +<h2 id="What%20is%20quality?">What is quality?</h2> + +<p>Quality is evaluated aesthetically, symbolically and functionally +Quality can be either objective or subjective. +Quality may not always be obvious.</p> + +<h2 id="Definition%20of%20quality">Definition of quality</h2> + +<p>Quality is a reflection of one or more peoples evaluation of the compliance of a product or service with their expectations. +Quality can be broken into three types of categories: +1. Product quality. +2. Process quality. +3. Quality of expectations.</p> + +<p>Quality tradeoffs are unavoidable. +Quality consists of: +- Quality assurance: plan or design processes to prevent bad quality. +- Quality control: track that work products meet quality standards.</p> + +<h2 id="Why%20invest%20or%20pay%20for%20Quality%20Management?">Why invest or pay for Quality Management?</h2> + +<p>Cost of not doing it is bad quality - fixing errors.</p> + +<p>Direct cost of error correction: +- Loss. (effort) +- Wasted work. (for users of the program) +- Maintenance usually has larger costs than development.</p> + +<p>Indirect cost of error correction +- Follows from poor quality (unsatisfied users) +- Has potentially severe consequences (losing customers)</p> + +<p>Quality Management reduces these costs significantly.</p> + +<h2 id="Validation%20(fit%20for%20use)">Validation (fit for use)</h2> + +<p>Are we building a system that is fit for use? +Compliance with the users expectations and experiences?</p> + +<h2 id="Verification%20(requirement%20specification%20being%20met)">Verification (requirement specification being met)</h2> + +<p>Do we pass all tests and requirements? +Are we building a system with all the requirements implemented? +Unit/integration tests</p> + +<h2 id="Techniques%20for%20verification%20and%20validation">Techniques for verification and validation</h2> + +<p>Testing: of programmes and prototypes. +Review: of specifications, documentation and programs.</p> + +<h2 id="Is%20it%20verification%20or%20validation?">Is it verification or validation?</h2> + +<p>A user must participate in order to validate. +Verification focuses on the compliance to the specifications and a client usually doensn’t participate.</p> + +<h2 id="V-model">V-model</h2> + +<h1 id="Q11.%20Test%20and%20review">Q11. Test and review</h1> + +<p>Tests are a set of practices that support verification and validation. +The purpose is to ensure a program does what it is supposed to, and to discover errors before delivery. +This is done by making sure the progrm meets the requirements and by finding incorrect or undesirable behaviour. +Verification: Unit test, component test. +Validation: prototype test, user acceptance test.</p> + +<h2 id="What%20is%20peer%20review?">What is peer review?</h2> + +<p>Evaluation of work of one or more people with similar skills (peers). +Mostly in the form of documents but can also be analysis of code.</p> + +<h2 id="What%20is%20the%20difference%20between%20review%20and%20test?">What is the difference between review and test?</h2> + +<p>Review is static, and there is no interaction between errors found in review. +Tests are dynamic and errors can come as side-affects of an initial errors. +Reviews (inspections) and tests are complementary to quality techniques. +Both should be used under the verification and validation process. +Inspections can control compliance with a specifications but not with the clients or users actual requirements. +(Unless the user participates in the review. Prototypes are preferred for user participation) +Inspecions cannot control non-functional properties such as performance, usability, etc.</p> + +<h2 id="When%20is%20review%20good?">When is review good?</h2> + +<p>For documents, designs, architectures, plans, etc.</p> + +<h2 id="When%20is%20test%20good?">When is test good?</h2> + +<p>For functionality and dynamic use of the program.</p> + +<h2 id="What%20is%20the%20V-Model">What is the V-Model</h2> + +<p>A model that shows the connection between tests at different levels and primary activities that drive the tests.</p> + +<h2 id="Name%20tests%20at%20different%20levels:">Name tests at different levels:</h2> + +<p>Unit test, component test, integration test, system test, user acceptance test.</p> + +<p>Unit test: confirm valid and invalid input. +Integration test: confirm that interfaces are compatible and work as expected. +Acceptance test: validate fit for use, exploratory test.</p> + +<h2 id="When%20is%20test%20done?">When is test done?</h2> + +<p>Plan driven: in the end (often a dedicated test-team aspart of QA) +Agile: all the time (test competence on the team, accept criteria on story, automated test, TDD)</p> + +<h1 id="Q12.%20Configuration%20Management%20and%20DevOps">Q12. Configuration Management and DevOps</h1> + +<h2 id="What%20is%20DevOps,%20how%20can%20you%20define%20it?">What is DevOps, how can you define it?</h2> + +<p>DevOps is a method for both development and operation. +DevOps is a development method for IT systems that connects different activities in projects. +DevOps is a culture, that focuses on the entire software productions life cycle. +The goal is to remove barriers between development and operation teams, to be able to react quickly to the users needs. +It is also defined by The Three Ways: +1. Flow. +2. Feedback. +3. Continuous Learning.</p> + +<h2 id="What%20is%20the%20purpose%20of%20Continuous%20Integration?">What is the purpose of Continuous Integration?</h2> + +<p>When the code is checked, it is automatically integrated with the system. +Speed up the rate of delivery and run tests constantly. +Bsed on tools to automate the process. +Depends on a suite of unit tests. +Does NOT eliminate the need for testers.</p> + +<h2 id="What%20is%20the%20purpose%20of%20Continuous%20Testing?">What is the purpose of Continuous Testing?</h2> + +<p>Continuous Testing in DevOps is a type of software test that involves testing at all stages of a develoments lifecycle. +The goal is the continuously evaluate the quality of the software.</p> + +<h2 id="What%20is%20the%20purpose%20of%20Continuous%20Delivery%20and%20Deployment?">What is the purpose of Continuous Delivery and Deployment?</h2> + +<h3 id="Continuous%20Delivery">Continuous Delivery</h3> + +<p>Ensure that code can be implemented securely. +Ensure that the business and service application function as expected and deliver every change to production.</p> + +<h3 id="Continous%20Deployment">Continous Deployment</h3> + +<p>Ensure that tests are automated and that every change is automatically implemented in production. +Makes the development and release process faster and more robust.</p> + +<p>Automated access to well defined environments. +Tools like Docker for containerization or Virtual Machines.</p> +<p class="footer"><a href="/">adamski.wtf</a></p> +</html> diff --git a/dst/game.html b/dst/game.html new file mode 100644 index 0000000..e4c461e --- /dev/null +++ b/dst/game.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>My game — adamski.wtf</title> +<link rel="icon" type="image/png" href="favicon.png"> +<link rel="stylesheet" href="styles/style.css"> + +<p class="header"><a href="/">adamski.wtf</a></p> +<p class="note">May 7, 2021</p> + +<h1 id="My%20game">My game</h1> + +<p>Aftershock (working title) is a multiplayer old-school arena shooter being made in Unity. It’s a hobby project that I have been working on since 2016. It started as a <em>warmup</em> project before jumping into developing an MMO, but I have since learned how much work goes into making just a multiplayer fps. Especially as a solo project. </p> + +<p>At it’s core, Aftershock is supposed to be my attempt at recreating a mix of Quake 3 / Quake Live along with whatever else I decide to add. </p> + +<p>Main features (so far):</p> + +<ul> +<li>p2p multiplayer</li> +<li>support for custom maps</li> +<li>vq3-like movement</li> +<li>rocket launcher + rocket jumping</li> +<li>health pickups</li> +<li>3 gamemodes (FFA, TDM, Race)</li> +</ul> + +<p>I’m in the process of rewriting a lot of systems in the game at the moment because I’m switching from janky p2p multiplayer to an authoritative server setup with client-side prediction. <a href="https://www.gabrielgambetta.com/client-server-game-architecture.html">more</a></p> + +<p><a href="https://www.youtube.com/c/rizen1">Gameplay clips</a><br/> +<a href="https://trello.com/b/ycQyrouQ">Follow my progress</a></p> +<p class="footer"><a href="/">adamski.wtf</a></p> +</html> diff --git a/dst/index.html b/dst/index.html new file mode 100644 index 0000000..ade208f --- /dev/null +++ b/dst/index.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<meta charset="UTF-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>adamski.wtf</title> +<link rel="icon" type="image/png" href="favicon.png"> +<link rel="stylesheet" href="styles/style.css"> + +<p class="header"><a href="/">adamski.wtf</a></p> +<p>Hello there!</p> + +<p>My name is Adam and I am a computer nerd studying at Aalborg University. I am interested in space, game dev, sailing and the outdoors.</p> + +<p>I’m currently working as a student developer at E-Komplet and I work on my multiplayer old-school arena shooter in my free time. I occasionally post videos of my game along with other stuff <a href="https://youtube.com/c/rizen1">here</a>.</p> + +<h2 id="Posts">Posts</h2> + +<p><a href="game.html">Project Aftershock // Rizen’s Arena</a></p> + +<h2 id="Links">Links</h2> + +<p><a href="https://github.com/adamstuck">Github</a><br/> +<a href="https://youtube.com/c/rizen1">Youtube</a><br/> +<a href="https://steamcommunity.com/id/rizen1/">Steam</a><br/> +<a href="https://www.twitch.tv/rizen1337">Twitch</a></p> +<p class="footer"><a href="/">adamski.wtf</a></p> +</html> diff --git a/dst/sitemap.xml b/dst/sitemap.xml new file mode 100644 index 0000000..26d4261 --- /dev/null +++ b/dst/sitemap.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<urlset +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 +http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" +xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> +<url><loc>https://adamski.wtf/SPO notes.html</loc><lastmod>2022-02-17</lastmod><priority>1.0</priority></url> +<url><loc>https://adamski.wtf/game.html</loc><lastmod>2022-02-17</lastmod><priority>1.0</priority></url> +<url><loc>https://adamski.wtf/index.html</loc><lastmod>2022-02-17</lastmod><priority>1.0</priority></url> +<url><loc>https://adamski.wtf/ase.html</loc><lastmod>2022-02-17</lastmod><priority>1.0</priority></url> +</urlset> diff --git a/dst/styles/style.css b/dst/styles/style.css new file mode 100644 index 0000000..557c0ca --- /dev/null +++ b/dst/styles/style.css @@ -0,0 +1,91 @@ +html { + background-color: #181a1b; + margin: 1em auto; + max-width: 52em; +} +body { + color: #ddd; + font: 1.0em/1.5 'Open Sans', sans-serif; + -webkit-text-size-adjust: 100%; + scrollbar-color: #454a4d #202324; + margin-top: 0; +} + + +h1 { + margin-top: 2.5em; + font-size: 2em; +} + + +a { + text-decoration-thickness: 1px; + text-underline-offset: 5px; +} +a, a:link, a:visited { + color: #fda; + text-decoration-color: #ca8; +} + + +pre, code { + font: 1.1em/1.5 monospace; +} +pre { + overflow-x: auto; + padding: .5em 1em; + background-color: #222; +} +code { + white-space: pre; + color: rgb(251, 252, 189); +} +pre code { + color: #ddd; +} + + +p img, table { + max-width: 100%; +} +img { + display: block; + margin-left: auto; + margin-right: auto; +} + + +blockquote { + background-color: #222; + border-left: 5px solid #e6c79a; + margin: 0em 1em; + padding-left: 1em; +} + + +.header { + font-size: 2em; + margin-top: 1.5em; + margin-bottom: 1em; +} +.footer { + margin-top: 2em; +} +.note { + margin: 0; +} +.header, .footer, .note, .note a { + color: #888; +} +.header a, .footer a { + color: rgb(198, 90, 90); + text-decoration-color: #555; +} + + +/* .button { + display: inline-block; + border-color: #fda; + padding: 0.5em 1em; + text-decoration: none; +} */
\ No newline at end of file |