SER 316 Final Exam Study Guide

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What does project tracking track?

Requirements met/Work completed Time Costs Quality Customer happiness

What is edge coverage?

Select test cases that visit every edge. Also called branch coverage.

What are the 4 types of software properties that can be measured?

Size Complexity Coupling Cohesion

What is the solution to a Duplicate Code code smell?

Solution #1: If inside same class, extract common code to private method Solution #2: If unrelated classes, refactor to a new class

How many testcases (minimum) do you need to get complete branch coverage?

3

What is a metric?

A metric is a standard of measure A software metric is interpreted according to a quality attribute Size, Complexity, Dependency, Cycle Time

What are the correct git commands for the different phases? To stage a change To save your changes safely in your repository To send your changes to your remote repository To get the information on your remote repository to your local repository

Add Commit Push Pull

Refactoring things to remember.

All tests are green. All duplication has been removed The code is as expressive as we can make it. The code is as simple as we can make it. XP refactors mercilessly. Refactoring is aided by relentless testing and continuous integration. The act of improving code design "in place" without modifying the functional behavior of the code Increase code quality A goal of refactoring is to move toward a design pattern

What does dynamic analysis do?

Analyzing the run-time behaviors of an executable element like a object or component.

What are the levels of static analysis?

Characteristic error checking: The static analyzer can check for patterns in the code that are characteristic of errors made by programmers using a particular language. User-defined error checking Users of a programming language define error patterns, thus extending the types of error that can be detected. This allows specific rules that apply to a program to be checked. Assertion checking Developers include formal assertions in their program and relationships that must hold. The static analyzer symbolically executes code and highlights potential problems

What is control flow analysis?

Checks for loops with multiple exit or entry points, finds unreachable code, etc.

What is Interface analysis?

Checks the consistency of routine and procedure declarations and their use

What are the 3 Design Pattern types?

Creational Behavioral Structural

Intent of a(an) ___________ pattern is to attach additional responsibilities to an object dynamically.

Decorator

What is data use analysis?

Detects uninitialized variables, variables written twice without an intervening assignment, variables declared but never used, etc.

What happens in Walkthroughs?

Developer presents code to a small group of peers Developer describes software Developer describes how it works "Walks through the code" Free-form commentary/questioning by colleagues Benefits Many eyes, many minds Purpose is to benefit the author Drawbacks Does not necessarily address the quality needs of the project

What are the different methods for counting LOC?

Different methods for counting LOC exist Method 1: Count each statement as 1, everything else 0 Method 2: Same as 1 except add ½ for each comment line Method 3: Same as 2, except add 2 for special constructs

What are some examples of code smells?

Duplicate code Long parameter list Switch statements Primitive obsession Long method Temporary field Large class

What is the solution to a Large Class code smell?

Extract a new class - find features that reflect unique concepts and delegate responsibility to the new class

In week 4 which quality practices do you have to include in your project?

GitHub workflow, Code Review, Unit Tests

List some types of reviews.

IEEE 1028-1997 Management Reviews Technical Reviews Inspections Walk-throughs Audits

What is Path analysis?

Identifies paths through the program and sets out the statements executed in that path. Again, potentially useful in the review process

What is Information flow analysis?

Identifies the dependencies of output variables. Does not detect anomalies itself but highlights information for code inspection or review

List types of peer reviews.

Inspections Team Review Walkthroughs Pair Programming Peer deskcheck / passaround Ad hoc review

What kind of coverage do JUnit tests have?

It depends on the implementation of the JUnit test, if there is a certain complete coverage.

Software Measurement Scales: Nominal Ordinal Interval Ratio

Nominal - Categorical; either equal or not equal Ordinal - Ranking; ordered but not ratio'd; <, > Interval - Ranked and Additive but not ratio'd; <, >, +, - Ratio - Existence of absolute zero; <, >, +, -, /

Code Review Process?

Plan the review; cover all the logistics System overview presented to inspection team Code and associated documents are distributed to inspection team in advance so they can prepare Inspection takes place and discovered errors are noted Modifications are made to repair discovered errors Re-inspection may or may not be required

What does static analysis look at?

Possible bugs - Empty try/catch/finally/switch blocks. Dead code - Unused local variables, parameters and private methods Empty if/while statements Overcomplicated expressions - Unnecessary if statements, for loops that could be while loops Suboptimal code - wasteful String/StringBuffer usage Duplicate code - Copied/pasted code can mean copied/pasted bugs and decreases maintainability. Security - particularly in dynamic languages Style Checking - considered static analysis but really its own thing.

What is the solution to a Long Parameter List code smell?

Solution #1: Preserve object - pass the entire object instead of just a single value Solution #2: Introduce parameter object - combine parameters into a new immutable object

Which of the following is not true for Measures and Metrics?

They can not be automated

Why do we assign points to user stories?

To assess the amount of work and potential complexity of a user story.

True or False. A User Story is usually considered too small if it only has one Task.

True

For each of the statements below, mark True if it is a best practice, False if not: -You should start a code review with clear objective. -Code reviews only exist to train junior developers. -Code review every single line formally. -Have standards in place before you start the review. -Only review what requires a person's time and brain; automate the simple stuff! -Code reviews can help train junior developers.

True False False True True True

Notes of the Review Spectrum.

Types of code reviews are a function of formality More formality --> more defects found --> higher quality Less formality --> fewer defects found --> less quality Don't ignore the social issues! Nobody enjoys having their work put under a microscope Emphasize the benefits to the reviewee A quality culture reinforces "we're all in this together", and reduces the potential for finger-pointing

When does a task get assigned to a team member?

When a task is moved to In Progress

What do we mean by quality policies in this course which you need to fulfill in your project?

You define them yourself and have to check your code before accepting a Pull Request to fulfill these Quality Policies.

How often should you have Stand-up meetings in your project?

You should talk at least 3 times a week.

A boundary value analysis does...

only check values between equivalence partitions.

What is the solution to a Speculative Generality code smell?

remove general code, method, class, etc.

Explain what Edge Coverage means?

Edge Coverage (also known as branch coverage) is a type of white-box coverage a set of test cases will need to ensure. This type of coverage guarantees that every branch/transition in the code is executed at least once.

Which type of coupling does the following code lead to? class Car{ Engine engine; Wheel wheel; Body body; }

Efferent coupling

What are the seven rules of a great Git commit message?

- Separate subject from body with a blank line - Limit the subject line to 50 characters - Capitalize the subject line - Do not end the subject line with a period - Use the imperative mood in the subject line - Wrap the body at 72 characters - Use the body to explain what and why vs. how

Testing values of the same equivalence partition yield...

... exactly the same result for any value.

Automated program analysis can be used to...

... find patterns that are known to be potentially erroneous.

Verification & validation (V&V) of critical systems ...

... have significantly higher costs than the V&V of non-critical systems.

Testing a program can...

... show the presence of bugs, but can never show their absence.

Thinking about your project and using Git and GitHub with your team members. Which files/folders should NOT be put into your version control. .classpath src/main/java README bin .project src/main/resources .gradle .settings build

.classpath bin .project .gradle .settings build

Is Lines of Code (LOC) a good measure of program complexity? Give 1 reason Why and 1 reason Why not. Do you consider LOC as a static analysis or a dynamic analysis measure and Why?

1 reason Why: Effort is highly correlated with SLOC, programs with larger SLOC values take more time to develop. Thus, SLOC can be very effective in estimating effort. 1 reason Why not: However, functionality is less well correlated with SLOC: skilled developers may be able to develop the same functionality with far less code, so one program with fewer SLOC may exhibit more functionality than another similar program. SLOC is also a poor productivity measure of individuals since a developer can develop only a few lines and yet be far more productive in terms of functionality than a developer who ends up creating more lines. SLOC is also particularly ineffective at comparing programs written in different languages unless adjustment factors are applied to normalize languages. Do you consider LOC as a static analysis or a dynamic analysis measure and Why? Static, because static program analysis is the analysis of computer software that is performed without actually executing programs

How many tasks should you have In Progress on the Sprint Backlog?

1-2

Which of the following is(are) a black-box testing technique? Equivalence partitioning Boundary Value Analysis Node coverage Path coverage

Equivalence Partitioning Boundary Value Analysis

One of the fields on a form contains a text box which accepts numeric values in the range of 18 to 25. Identify the invalid Equivalence class. 21 20 17 19

17

What is the Cyclomatic Complexity of the following piece of code? public int getValue(int param1) { int value = 0; if (param1 == 0) { value = 4; } else { value = 0; } return value; }

2

In an Examination, a candidate has to score a minimum of 24 points in order to pass the exam. The exam has a maximum of 40 points. Identify the Valid Equivalence values for the student to pass the exam. 23, 35, 41 29,30,31 21,39,40 22,23,26

29,30,31

What is the Cyclomatic complexity of following piece of code? If (Condition 1)Statement 1ElseStatement 2 If (Condition 2)Statement 3ElseStatement 4

3

A program validates a numeric field as follows: values less than 10 are rejected, values between 10 and 21 are accepted, values greater than or equal to 22 are rejected. Which of the following covers the MOST boundary values? 10,11,20,21 9,10,11,22 10,11,21,22 9,10,21,22

9, 10, 21, 22

Which of the following annotation is not supported in JUnit? @Before @RunWithout @Test @BeforeClass

@RunWithout

What is Git?

A distributed version control system

What is the difference between a formal and an informal code review?

A formal code review usually needs preparation while an informal one might just mean asking my team member to look over what I wrote.

What is a function point?

A function point is a "unit of measurement" to express the amount of business functionality an information system (as a product) provides to a user.

Which of the following can not lead to increase in coupling between two classes A and B?

A is not a subclass of (or doesn't implement) class B

What does static analysis with model checking require?

A model checker that explores all possible paths of the finite state model of a system.

A pattern is a recurring _____________ to a problem in ________________.

A pattern is a recurring [solution] to a problem in [context]

What is a Pull Request?

A team member can issue a Pull Request to ask the team to approve of a change to be merged into another branch.

What is Equivalence Partitioning?

An approach to Blackbox testing that divides the input domain of a program into classes of data from which test cases can be derived.

On what criteria should Blackbox tests be implemented?

Anything but looking at the respective code, e.g. documentation, specification, requirements...

What is Boundary Value Analysis?

Boundary Value Analysis is a black box technique where test cases are designed to test the boundary of an input domain.

What should you not look for in code reviews?

At personal programming style.

Match each design pattern with it's description. Builder Pattern Abstract Factory Pattern Singleton Pattern State Pattern Observer Pattern

Builder Pattern - step-by-step creation of complex objects using the correct sequence of actions Abstract Factory - Provide an interface for creating families of related or dependent objects without specifying their concrete classes Singleton Pattern - Allows real object instantiation instead of static objects and ensures that the class has only one instance within a program State Pattern - Provides behavior to an object so that it can be changed during runtime, implementing a state machine. Observer Pattern - Two concrete objects inherit the attributes of the related abstract objects. When a state changes, all displays are automatically notified and updated Strategy Pattern - A family of algorithms are made interchangeable through encapsulation.

What method statistically finds the most defects?

Code Reviews find 65%

Which of the following refers to the degree to which the elements of a module (Links to an external site.) belong together?

Cohesion

Which of the following refers to the degree to which the elements of a module together?

Cohesion

What is cohesion?

Cohesion refers to the degree to which the elements inside a module belong together. In one sense, it is a measure of the strength of relationship between the methods and data of a class.

What is the worst type of cohesion?

Coincidental cohesion - it is when parts of a module are grouped arbitrarily

Which of the following refers to the degree to which one thing can work independently of another (or not)?

Coupling

What is coupling?

Coupling is the degree of interdependence between software modules; a measure of how closely connected two routines or modules are; the strength of the relationships between modules.

What's the difference between coupling and cohesion?

Coupling refers to the interdependencies between modules, while cohesion describes how related the functions within a single module are.

Which of the following are considered "code smells" Data clumps char arrays as strings Lazy Class Feature Envy Incomplete Testing Multiple Inheritance Large Class Floats Long Parameter List

Data clumps Lazy Class Feature Envy Large Class Long Parameter List

What does complete node coverage for a method mean?

Every line of code in the method has been used in the tests.

Match the design pattern in first column to its type in second column. Singleton Abstract Factory Observer pattern Strategy pattern Decorator pattern Adapter pattern

Creational Pattern Creational Pattern Behavioral Pattern Behavioral Pattern Structural Pattern Structural Pattern

What are the principles of agile methods?

Customer involvement: Customers should be closely involved throughout the development process. Their role is to provide and prioritize new system requirements and to evaluate the iterations of the system. Incremental delivery: The software is developed in increments with the customer specifying the requirements to be included in each increment. People not process: The skills of the development team should be recognized and exploited. Team members should be left to develop their own ways of working without prescriptive processes. Embrace change: Expect the system requirements to change and so design the system to accommodate these changes. Maintain simplicity: Focus on simplicity in both the software being developed and in the development process. Wherever possible, actively work to eliminate complexity from the system

What is the best cohesion?

Functional cohesion - is when parts of a module are grouped because they contribute to a single well-defined task of the module

What information do you have to include into your commit messages?

Descriptive comment on what you did Task Number from the Sprint Backlog

How often should you check your continuous integration tool?

During every stand up meeting and every time you finish a task.

When should the majority of tasks be created in the Sprint Backlog?

During the Sprint Planning session (before the sprint)

Match each estimation technique with it's definition: Planning Poker T-Shirt Sizes Relative Mass Valuation

Each team member writes a number on a card and they explain why each was rated so high or low. Numbers are not used for evaluation. Visualize story size by changing their position in relation to one another. Order the stories from smallest to largest.

What forms of static analysis exist (including but not limited to)?

Formal verification, model checking, automated program analysis

When should dynamic and/or static analysis be used?

From the beginning of the project/implementation.

Which of the following is the best cohesion type, out of the ones mentioned below?

Functional cohesion

What is "smoke" testing?

It tests essential features of a program, ensuring it builds.

Reviews usually try to find:

Logical errors Code Smells Style errors Naming conventions Bugs

Which of the following is a kind of Behavioural pattern? Builder Abstract Factory Proxy Composite Observer

Observer

Assume your task is to implement a single client server application. The server can send and receive multiple values from and to clients. The clients can generate different visualizations for the values they receive and will be notified if values change. The application should follow object-oriented design. Propose the various design patterns you feel should be used in developing this application. Please state why you chose the patterns you suggested.

Observer pattern: This pattern can be used to publish changes to an object's (server) state, and other objects (clients) can subscribe to be immediately notified of such changes. Decorator pattern: This pattern can be used to extend or alter the functionality of objects at run-time by wrapping them in an object of a decorator class

How often should you update your Quality Policies for this project?

Once a week

How many branches should you create in your Git workflow?

One for each User Story

Who has the authority to cancel the Sprint?

Only the Product Owner

Name the 3 different roles in a Scrum process and explain their what they are responsible for.

Product Owner - the person with the product vision, who breaks down the project into tasks that maximize the value of the product from the Development Team Scrum Master - is responsible for removing impediments, enforcing the Scrum rules, observes and gauges team progress, makes immediate decisions in the face of uncertain or incomplete information. Development Team - The professionals who do the behind the scenes work of creating a potentially releasable version of the product at the end of each Sprint.

What does static testing do?

Testing a unit without executing the code

What is node coverage?

Select test cases that visit every node in the graph. Also called statement coverage.

What is path coverage?

Select test cases that visit every path. Loops are a problem.

Why is it important to work at a consistent rate in your project?

So the team knows if it gets done in time.

Which of the following are the prinripal artifacts in scrum? Sprint Backlog Product Backlog Daily Scrum Sprint Burndown

Sprint Backlog Product Backlog Sprint Burndown

Put the following in the order of their exection. 1 2 3 4

Sprint Planning meeting Sprint Sprint Review Sprint Retrospective

What is a Sprint?

Sprints are short iterations designed to produce working software. Sprint mini how-to: 1. Define your Sprint Goal 2. Conduct a Planning Session 3. Execute the Sprint 1. Take responsibility for a Story on the Sprint Backlog 2. Conduct daily standups 3. Monitor the Scrumboard, Burndown and CI/Test dashboards 4. Large (Spike) and small (manipulate tasks) as needed 4. Conduct a sprint review 5. Conduct a retrospective 6. Lather, rinse, repeat - goal is to create a rhythm

What is the difference between static code analysis and dynamic code analysis?

Static code analysis tests the code without executing the code, while dynamic code analysis tests the code by executing a program unit using test data.

Which of the following is not a type of coupling in procedural programming?

Temporal coupling

What is whitebox testing?

Test cases designed, selected, and run based on the structure of the source code.

What is the difference between a decorator and adapter design patterns?

The Decorator Pattern is handled dynamically, and it adds behavior to the object it wraps. Structurally it inherits and contains the component. The Adapter Pattern is handled statistically and it adjusts the interface of the object it wraps. Structurally, it contains an adaptee.

What is the Sprint Retrospective?

The Sprint Retrospective is an opportunity for the Scrum Team to inspect itself and create a plan for improvements to be enacted during the next Sprint

Why are switch statements considered a "code smell?"

The same switch statement are often found scattered about a program in different places where polymorphism would be better utilized.

Who checks the Quality Policies in your project before a merge into master?

The team or part of the team

Which of the following is possibly not the purpose of measuring a software? Software is measured to: Establish the quality of the current product or process. To predict future qualities of the product or process. To improve the quality of a product or process. To determine the state of the project in relation to budget and schedule.

To predict past qualities of the product or process.

What is(are) the possible workflow(s) to remove a file from git? -Use git rm FILE, then commit and push -Remove the file from your system, then git add, commit, followed by push -just delete the file from your project -go to github, delete the file manually and commit changes

Use git rm FILE, then commit and push Remove the file from your system, then git add, commit, followed by push go to github, delete the file manually and commit changes

Below are some statements about unit tests. Match them to Black box or White Box testing. Tests the internal structure of a method. Only checks input and output relation. Are based on the documentation not on the code itself. Often node graphs are used to create them. Do usually not change when refactoring the tested code. Do usually have to change when refactoring the tested code.

White Black Black White Black White

What should be true for your master branch on GitHub?

Your master should be a stable, working copy of your project. Only tested code should go into it.

Why is continuous integration an integral part of Agile?

Your team is more likely to find errors early on, and the whole team can see the results of progress at all times.

JUnit testing is...

a dynamic testing technique.

In a git repository, which of the following is not a state for a file to be in?

added

The state design pattern changes the behavior of an object ________________________.

at runtime by overriding internal functionality based on the object's state.

Continuous integration and testing benefits include: automated testing visibility - everyone "sees" the build status all the time Fewer testing functions need to be written catching defects early

automated testing visibility - everyone "sees" the build status all the time catching defects early

The use of patterns in a development organization raises the overall quality of code for many reasons. Select options that represent ways that patterns raise code quality provides a target for refactoring raises the common vocabulary of the team improves low-level design reuses lessons learned by master practitioners

provides a target for refactoring raises the common vocabulary of the team improves low-level design reuses lessons learned by master practitioners

What is the aim of design patterns?

solving the problem of object generation and interaction

Backbox Unit Tests are written based on...

the specification


Ensembles d'études connexes

GNRS 556 - Med Surg II Study Guide for Test #3 (IN PROGRESS)

View Set

BVU BIO120- Intro to Human Biology Final Exam

View Set

Chapter 4: Income Statement, Comprehensive Income, and the Statement of Cash Flows Intermediate Accounting 1

View Set

Chapter 9: Travel and Tourism - World's Largest Service Industry

View Set

Info Systems Midterm Study Guide

View Set