Flashcards
CS-135 part 1
Cards in this deck (200)
- 1Which standard is used for software engineeringISO 9001
- 2What are the two types of comments?Documentary and strucural
- 3What are documentary comments?comments that provide basic info on a file
- 4What are structural commentscomments what functionality the single methods in a class provide
- 5Name 8 things documentary comments provide1. file name
2. version number
3. creation date
4. last modified date
5. authors name
6. copyright notice
7. purpose of the program
8. version history - 6Where do you find documentary comments?at the start of any program file
- 7give an example of a structual comment/ program structure descriptionsstatic boolean hasNextChar()
- 8What do structural comments doprovide an overview on what functionality is available in the form of methods.
Concise description explaining how to use the functionality - 9Name the 5 comments which are required1. describe in words what the method does
2. Formula - how the result isa computed out of the parameters (if applicable)
3. explain the parameters
4. state any side effects
5. state if the method is referentially transparent - 10If a method is side effect free, what does this mean?if the method does not change any global state of the program. (when you change a global variable)
- 11If a method is Referentially transparent, what does this mean?a method is referentially transparent itss return value (weith identical actual parameters) is independent of the program context (when you output the value of a global varibale)
- 12Name two types of maintenanceAdaptive
perfective - 13What is adaptive maintenancechanges to the original purpose
- 14Describe perfective maintenancecorrects bugs + improvements
- 15What does legacy code requiremaintenance
- 16Define sustainable software codewell documented code
well written
test documents
this reduces maintenance time and costs - 17What is software engineeringsystematic development of software products
- 18What does a software product includeRequirement documents
design documents
program
user manual
system manual - 19What does the term "programming in the small" mean?within one module - how does this module work
- 20What does the term "Programming in the large" mean?How do the modules work together using several modules
- 21Javadocused to document java classes
- 22What is the java doc commandjavadoc -d -version -author
- 23Name some of the tags available in Java doc@author, {@code}, {@docRoot}, @deprecated,
@exception, {@inheritDoc}, {@link},
{@linkplain}, {@literal}, @param,
@return, @see, @serial, @serialData,
@serialField, @since, @throws,
{@value}, @version - 24What does @Author doAdds an author entry with the specified name - text to the generated java doc when the -author option is used
- 25What does @version doAdds a version subheading with the specified version - text to the generated docs when the -version option is used
- 26What does {@code text} doDisplays text in code font without interpreting the text as HTML markup or nested javadoc tags. This enables you touse regular angle brackets (< and >) instead of teh HTML entities (< and >)
- 27What does @param doAdds a parameter with the specified description to the parameters section
- 28what does @return do?Adds a returns section with the description text. This text should describe the return type and permissible range of values. This tag is valid only in a doc comment for a method.
- 29Whats HTML?HTML, an initialism of HyperText Markup Language, is the
predominant markup language for Web pages. It provides a
means to describe the structure of text-based information in
a document - 30How do you implement a stackpush -add to top
pop- take top item
top - look at top - 31What is the application of a stackImplementation strategy in compliers for method calls
- 32What leads to an error messageWhen the stack is full and there is no memory left
- 33What does top of stack variable dovariable, if empty stack = -1
one item = 0
2 items in stack = 1 - 34What are the two mistakes that can happen on a stack of limited sizepush on a full stack
pop on an empty one - 35What is errorFreeboolean variable, signal to say these mistakes have not appeared in the stack's history.
errorFree is set to True
if error occurs=false - 36define conceptan abstract idea
- 37define constructa physical thing which is deliberately built or formed
- 38what do tools dooffer constructs to realise concepts. e.g. javadoc offers @author tag to realise the concept of doc "author" comment
- 39what tools does javadoc also support?1. write "narrative" describing what a method does
2. to explain the paramenters with @param
3. to provide formula / how result is computed out of params with @return - 40What does javadoc fail to do?offer construct to support commenting if method is referentially transparent or if the method has side effects
- 41what types of methods can be referentially transparent?not void ones. as referentially transparent returns the value of a global variable
- 42define IDEAn integrated development environment (IDE) is a software application that provides comprehensive facilities for software development.
- 43what are the 4 thing an IDE contains1.source editior
2.compiler/interpreter
3.build automation tools
4.debugger - 44What is the IDE marcus likesEclipse
- 45What is eclipsea multi language software development platform comprising an IDE and a plug in system to extend it. Writteen in java, its used in other languages like c/c++, python, perl, PHP and more
- 46what does a console come withCommand line interpreter
- 47name and explain these tools Terminal editior compiler javadoc IDEhaah good luck
- 48What's alexanders help on How to write guidelinescoding rules are often soft/ rule of thumb. Alex says
Rule, example, discussion, link to related rules. - 49What is a test suiteA collection of test cases
- 50whats a test caseExperiment you want to test
- 51name 4 things in the program structure you should comment1.variable declarations
2.branching structures (if, switch)
3. loops (while, do, for)
4.method declarations - 52How do you perform variable declarations?Explain for each variable what it represents in the context of the program. e.g. int i /*counter*/
- 53State the rule for branching structuresState the purpose of the whole branching structure, explain what happens in each of the cases.
e.g. if (){
then /*what happens*/
}else{ /*this happens*/ - 54State the rule on loopsState the purpose of the whole loop structure, explain how the computation takes places, discuss termination of the loop
/*this loop */
/* does this */
/*thing*/
for{} - 55What is the rule on over-commentingAvoid trivial comments e.g
.
for (int k = 0 .....) /* k is a counter */ - 56what does LIFO stand forlast in first out
- 57Which data structure applies LIFOStack
- 58What are the three commands for stackspush pop top
- 59What does FIFO stand forFirst in, first out
- 60What are the 3 commands for queueenqueue dequeue empty
- 61Where are queues used inprocess queues of the OS
- 62how do you establish conformance between specification and a program?testing, but complete testing is impossoible so we only test selected cases
- 63what does SUT mean?system under test
- 64How do we establish a programs quality?test that the SUT conforms to a specificatiom
- 65in our context what is a SUT and specification?SUT = java method/class
specification = computational problem - 66What does a test case consit of?name,
input value
expected value - 67Whats a test suitea collection of test cases
- 68where does an activity diagram come from?UML unified modelling language
- 69draw an activty diagram
- 70how do we design a test suteactivity diagram
- 71what does test execution entailperforming the experiments as described by the test cases. execute the SUT for each test case. i.r. provide the inputs for the SUT, fill in a column "actual result" of the previous table. no need to execute test cases with result "dont know"
- 72What is test evaulationchecking that the actual result = expected result. pass if they do, fail if not.
- 73draw a test evaluation table
- 74What 3 bits of test documentation do we needfiles that
1. evidence that test execution has happened
2. the actual results
3. test evaluation - 75why do we need test documentation?part of the safety case when one asks for certification (legal disputes)
- 76Why is the design of test suites important?complete testing is impossible, with many possibilities it would take too long
- 77What are the main approaches for testingwhite box
black box - 78what is white box testing?test case selection based on program code
- 79what is blackbox testingtest case selection based on specification
- 80give a vague outline of a system lifecycleRequirements 15-20%
analysis and design 15-20%
construction 25/30 %
system testing 15/20 %
implementation 5/10% - 81what is rationale of boundary value analysisits a focus on the boundary of the input space.
- 82what are the rationales of boundary value analysisloop conditions often < instead of <=. counters are often off by 1 etc.
Lots of faults at boundary of input - 83What sort of boundaries do inputs havee.g. array sizes e.g. 720*1040 from the screen resolution
Physical limitations include
-no more than 31 days in month
load capacity of elevator
temp (max, min)etc - 84What is the first step in boundary value analysisfor each inout define the
min
min+ (just above min)
nom (normal value)
max- (just below max)
max - 85What is the single fault assumptionFailures are only rarely the result of the simultaneous occurrence of two (or more) faults
- 86what is step 2 of the boundary value analysis. after you have made the single fault assumptiongenerate test cases
- 87what 2 things allow you to generate your test cases for step 2 in boundary value analysis- keep all but one variable at their normal values
-let that variable range over all the values form their previous slide. - 88If you have n input variables how many test cases do you need4n + 1
- 89draw a boundary class testing diagram
- 90Draw a boundary test case table
- 91drecap : define 4 steps of testing1.design of test suite
execution of test suite
test evaluation
test documentation - 92define design of test suitechoosing test inputs & determining the expected results
- 93define execution of test suiteobtaining actual results
- 94define test evaluationdetermining pass or fail for each test case and for the test suite as a whole
- 95define test documentationdocument execution and evaluation
- 96How is junit usefulsimple framework to write repeatable tests.
JUnit automatizes test execution and evaluation
CON: needs to encode test suites into special format - 97example of encoding test suite
- 98What does @Test meanfollowing methods are tests
- 99what does assertEquals do?first parameter is the expected output
second parameter calls the SUT with the input value as actual parameters - 100Describe the file structure in eclipse of the SUT and test casesfiles are on the same level
- 101how do you execute testsuse run button
- 102name some further assert methodsassertFalse
asssertNotNull
assertNotSame
assertNull
assertSame
assertTrue - 103define equivalence class testingthe SUT will behave "the same" for certain classes of inputs
- 104What do we need to test in equivalence class testing to ensure the system is well testedall possible behaviors
- 105A relation is considered equivalence relation if it has three properties, name them.reflexive
symmetric
transitive - 106Define partitionA set P of nonempty sets is a partition of a set x if
1. the union of the elements of P is equal to X
2. the intersection of any two distinct element of P is empty. (pairwise disjoint) - 107What are the two steps for equivalence class testing1. define partitions for each input domain
2. identify test cases by randomly choosing one element from each equivalence class - such that for each class there is at least one test case - 108example of equivalence classes and a minimal test suite for equivalence class testing
- 109draw an equivalence class testing diagram
- 110what does robustness concern?robustness means can the system handle unexpected inputs
- 111How do you extend BVA (boundary value analysis) for robustness?forces attention on exception handling.
- 112what do you add to BVA to increase robustnessadd max +
min -. - 113draw BVA diagram with added values
- 114How do we extend equivalence class testing.classes for valid inputs & invalid inputs
- 115whats the difference between extended and normal equivalence class testingnormal does valid inputs
extended does invalid and valid - 116Draw a diagram for extended equivalence class testing
- 117draw a diagram for normal equivalnce
- 118define equivalence classes for dates
- 119define all the equivalence classes for dates
- 120For test evaluation what are the different stagesMiL - model in loop
PiL -processor in loop
HiL - hardware in loop - 121What is Abstract Syntax Notaion One(ASN.1)a standard and notation that describes rules and structures for representing, encoding, transmitting and decoding data in telecommunications and computer networking
- 122How do test technologies us ASN.1enable your test environments to speak the language of the system you are testing. The automatic import of interface specifications and the automatic import of interface specs and auto generation of codecs free customers from the burden of dealing with test system implementation issues.
- 123Name the two things JUint doestest execution (send stimuli to the SUT, observe reactions)
test evalutation (compare actual and expected results, give verdict) - 124Whitebox testinggraphs
- 125what is a directed graphhas nodes and edges and direction
- 126describe indegree and outdegreeindegree is the number of distinct edges that end in the node
outdegree is the number of edges that start at the node - 127what are the three types of nodesindegree = 0 - source node
outdegree = 0 is a sink node
other nodes are transfer nodes - 128what is a directed patha sequence of edges such that , for any adjacent pair of edges in the sequence, the end node of the first pair of edges in the sequence, the end node of the first edge is the start node of the second edge
- 129define a cycleis a directed path that begins and ends at the same node
- 130What counts as a directed graph?a java program where nodes are statements and edges represent the flow of control.
- 131What is one path of a programevery terminating execution of a program corresponds to one path through the program graph, beginning at the source node and ending at the sink node.
- 132whats the notation of drawing a path<(start node, end node), (s,e) , (s,e)>
- 133draw a program graph for sequences
- 134draw a program graph for conditionals (if statements)
- 135what are program graphsabstractions from programs
- 136draw a program graph for a while loop
- 137Name some coverage criteria C's.C0, C1, CiK
- 138What does C0 mean?every node.
Find a set of test cases such that, when executed, every node of the program graph is traversed at least once - 139what does Cp mean?every branch.
find a set of test cases such that, when executed, it covers all branches of the program. - 140what does CiK mean?every loop up to k times.
Find a set of test cases such that, when executed, every loop is executed up to k times. - 141draw some example paths.
- 142specification notationUML
- 143What are the two types of UMLstructural
behavioural - 144Name some structual diagramsprofile
class
composite structure
component
deployment
object
package - 145name some behavioral diagramsactivity
use case
state machine
interaction diagrams - like
sequence, communication, interaction overview, timing - 146Draw an interaction diagram of an ATM machine
- 147draw a composite structural diagram
- 148draw an interfaces diagram
- 149draw a protocol state machine UML
- 150draw a state machine
- 151Summarise UML modellingone system - several models
different purposes - different UML diagram types
different diagrams - share info - 152draw a Ci(O) path
- 153What's the point of coding convensions-code easier to read
communication is easier and code is more legible
-more legible software contains fewer bugs so its more stable.
legible software is more flexible, encourages re-use - 154good conventions can lead to less bugs ... give an exampleNOT if (x == SOME_CONSTANT)
USE if (SOME_CONSTANT == X)
So if = is missing, you cant change the constant - 155name 8 coding conventionsindentation
placement of {}
white space around operators
naming schemes
max length lines
max length methods
max depth nesting
commenting - 156What beginning comments should java source files have/*
classname
version info
copyright notice
*/ - 157what is the order at the start of java source filecomments
import statements
class declarations - 158whats the order of java files in a classclass documentation comment /**...*/
class statement
class (static) variables (first public, then protected then private)
constructor
methods - 159whats the standard for indentation4 spaces. tabs and white space are allowed.
Although markus doesnt like tabs - 160whats the max line length80 chars
- 161Whats the rule with declarationsone declaration per line
- 162Where do you place declarationsat the beginning of blocks. a block is any code surrounded by {} e.g. at the start of a method
- 163what are standards for java classesno space between method name and (
open brace on the same line as the declaration
closing brace is on a line by itself correctly indented
methods are separated by a blank line - 164example of class coding standard
- 165example of if statement
- 166example of for loop , while, do while coding style
- 167what are the rules on spacingspace between keyword and (
e.g. while (param).
but no space between method name and {
A blank space after commas in argument lists - 168what about +, -, =should all have blanks a + b = c
but not inbetween ++, -- - 169What is tool checkstyledevelopment tool to help progers write code in correct style.
- 170What is the IEEEComputer Society's Software Engineering Body of Knowledge
- 171what's the IEEE's defintion of fotware engineeringthe application of systematic, disciplined, quantifiable approach to the development, operation and maintenance of software, amd the study of these approaches, that is the application of engineering to software
- 172What does SDM stand forSoftware Development Model
- 173What does SLC stand forSoftware Life - cycle
- 174What are SDM/SLC?a structure imposed on the development of a software product.. there are several models for such processes, each describing approaches to a variety of tasks or activities that take place during the process
- 175What does SDM/SLC address?what shall we do next
how long shall we continue doing it - 176Name 3 types of SDMwaterfall
spiral
v model - 177What are the phases of the waterfall methood?requirement elicitation and analysis
|
specification
|
implementation
|
test
|
maintenance - 178What do you need in the specification levespecification notations
- 179what do you need in the implementation levelprogramming languages
- 180what do you need to use n the testing phasetesting langauges
- 181What are the 3 documents produced in the design phase of the waterfall methodsystem architecture
user handbook
verification plan - 182what documents are produed in the implementation and debugging phaseimplemented modules and their documentation
2) test data - 183what are the documents produced in testingrunning system
evaluation of the software project - 184draw a diagram of the spiral model
- 185how does the spiral model startby a hypothesis that a particular operational mission could be improved with a software effort
- 186How do you terminate a project early with the spiral modelinvolves a test of the hypothesis at any time. if it fails, the spirat is terminated. Otherwise it terminates with the installation of new software and is tested by observing the effect on the operational mission
- 187Draw a diagram of the V-model
- 188what does XP stand forextreme programming
- 189what does XP claimlower costs
fewer defects
higher productivity - 190What is a team of XP made oftesters
interaction designers
architects
project managers
product managers
executives
technical writers
users
programmers - 191what is a storya requirement
- 192How is time managed in XPweekly deployment
once a quarter reflect on - 193whats included in the weekly deploymentreview progress
customer picks a week's worth of stories
break stories into tasks
team members sign up for tasks - 194what is included in the reflectthe team
the project
its progress
its alignment with larger goals - 195what are the 2 coding principleswrite tests first
ten minute build - automatically build the whole system and run all of the tests in ten minutes - 196what are the differneces between XP and waterfall methodsless documentation
higher flexibility
less thought through architecture - 197in XP, what replaces specification from the waterfall methodtests
- 198in XP what replaces the verification plan10 minute build
- 199in XP what replaces the waterfall module documentationcode commenting
- 200why does XP have higher flexibilitysystem specification can change
user/market needs can be taken on board all the time
Information
- Description
- Code commenting idea of testing blackbox whitebox specification code formatting start of SE
- Created by
- liz simpson
- Views
- 7
- Rating