Soft Dev Flashcards

1
Q

Purpose of SDL

A

-Represents the development of software as phases or sets of activities
- Is driven by the desire to define a predictable process to improve quality
- Involves creating processes that can be effectively managed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Types of Software Development

A

-Waterfall
-Prototyping
-Rapid Application Development
-Agile

The selection is dependent on the project type and resources available

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the waterfall approach

A

It breaks the SDLC into distinct sequential phases. Each phase needs to be signed off before moving on. Projects are well-documented, but errors propagate through if not spotted, which is very expensive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why are iterative or incremental designe processes often used

A

-It allows you to build on an existing platform, that you have confidence in
-It reduces the amount of time and resources required to develop a new product
-It reduces the risk of failure, or issues that could delay release

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why might incremntal changes not be enough

A

-The potential capacity of the design has been reached
-The new spec is beyond the capabilities of the previous design
-The previous design is not compatible with the new assembly it needs to integrate with
-The requirements priorities have changed and the previous design is not efficiently suited

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

On a V diagram what phases match with each other

A

Requirement analysis - System in use report
Requirement specification - System test
Functional design specification - Integration test
Detailed design - Unit test
Implementation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain Rapid application Development

A

-Heavy focus on tool use to reduce development time and costs (IDEs, GUI builders, database management systems)
-Planning and software implementation are interleaved
-Business need paramount
-Often development deadline prioritised over requirements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is agile development

A

Development based on short iterative sprints. Examples include scrum and pair programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain scrum

A

-Based on short fixed-length sprints
-Typically 2-4 weeks long
-Aim to produce deployable software in each sprint
-Sprint planning meeting
-Daily scrum meeting
-Sprint review meeting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain pair programming

A

-Two people working on a single task - one programs and the other is responsible for direction
-Roles are reversed periodically
-Better productivity than working independently
-Promotes dissemination of project knowledge among the team
-Good for transferring skill to junior developers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Advantages of agile development

A

-User engagement
-Rapid development of usable product
-Early testing catches bugs and results in high quality product
-Small incremental changes mitigate the potential risk of introducing a large change to a system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Examples of design documents

A

-Software architecture
-Data flow diagram
-State transition diagram
-Flowchart
-Commented code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the two types of nested classes

A

-Static nested (doesnt have access to instance members)
-Inner (has access to intance members)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What modifers can a nested class be declared with

A

-Public
-Private
-Protected
-Package private

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How are the nested classes accessed

A

-static nested: using the enclosing name
-inner: using an instance of the enclosing name
-all nested classes can be accessed externally through either the containing class or object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are local classes

A

Classes that are defined and exist in a block/method. They cannot contain public, protected, private or static access modifiers. They cannot access local variables unless they are declared as final. They can access all the members of the outer class instance like inner class members.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are anonymous classes

A

They are declared without any name at all. They can be defined in a method or in an argument to a method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are enums

A

They are used for creating variables with specifc ranges. They can be declared as a separate class, or as a class member, but not internally in a method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are threads

A

-Treated as a lightweight process
-Every process has at least one thread
-Threading allows for shared memory space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How does the OS handle threads on a single and multicore processor

A

-Single - virtually in parallel
-Multi - actually ran in parallel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is liveness

A

The issue of the code not performing correctly in time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How are threads created in Java

A

-Extending thread class
-Implementing runnable interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is a race condition

A

Two threads trying to access/change data at the same time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How do you use synchronise

A

Synchronise can be used on a method or a few statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is an atomic action

A

It happens or it doesnt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is the volatile keyword

A

It is used on variables to make read and writes atomic for them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is Deadlock

A

When two threads need a resource from each other but neither can continue until they have it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is Starvation

A

When a thread cant gain regular access to shared resources because another thread is frequently calling the object’s method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is Livelock

A

Like deadlock, except the two threads are too busy repsonding to one another to do work

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What is wait()

A

Waits for a condition to occur, must call from synchronised method/block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is notify()

A

Notifies a waiting thread a condition has occurred, must call from synchronied method/block, allows for thread communication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is sleep()

A

Similar to wait(), does not need to occur in synchronised block, retains lock when called and sacrifices the remainder of its time slice, can only be woken by interruption

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What is yield()

A

Changes running thread to runnable, allows other threads to execute, if no threads of same prority need to execute, execution continues, identifies current thread as not doing anything important

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What is join()

A

Allows one thread to wait for the completion of another, responds to an interrupt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is explicit locking

A

Locks can be created, moved and destroyed through the Lock object. They can be managed using the Lock interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

Can multiple objects share a lock

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

Can an object have more than one lock

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What is version control

A

Records changes over time, and specific versions can be recalled later

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What are the 4 version control systems

A

-Git
-Mercurial
-Concurrent Versions System
-Subversion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What are the 4 web-based repositories

A

-Github
-Bitbucket
-Google code
-Subversion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

Properties of version control

A

-Gives a project-wide undo button
-Allows multiple devs to work on the same code base in a controlled manner, with code not being lost through overwrites
-Keeps a record of changes and who did it, with reasoning
-Can support multiple releases at the same time - development doesnt need to freeze before release
-Can look at old versions, which is useful if customers have an issue with an old version
-Has a repository to store all project files/documents/directories
-Repository acts a server, usually based on a safe, secure and reliable machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

What are the similarities and differences between centralised and distributed repositories

A

Similarities: There may be multiple workstations
Differences: Centralised only has one repository and others can see changes made as soon as they are committed, distributed repositories have devs pushing changes and pulling requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What is the trunk

A

The main code base that developers are working on

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What is a potential problem that may arise with the trunk

A

At the time of a new release some team devs may be fixing bugs and evaluating quality. The devs will need stability, but freezing development will waste resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

What is branching

A

It is like having two separate repositories. Each branch has its own history and tracks its changes independently. Changes can be merged back into the main trunk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What is forking

A

Historically means a schism in the dev tem or a new dev team working on a new code derived from the old

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

What is the concept of operations

A

-Provides a statement of goals and objectives of the system
-Includes strategies, policies and constraints affecting the system - therefore contextualises the system
-Clear system of responsibilities and authorites to the various participants invlove in the system
-Specifies the process for initiating, developing, maintaining and retiring the system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

What is requirement analysis

A

-Requirements gathering
-Clear and complete requirements
-Formal documentation of requirements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

What is high level design

A

Will describe the platforms, systems, products, services that the developed system will depend on, will typically include an architecture diagram showing the interface, components and networks to be developed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

What is detailed design

A

Specifies how the system will be constructed such as functions, objects, and method details

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

What is unit testing

A

-Testing individual blocks of code in terms of correctness
-In procedural programming this will at function level
-In OOP this is at the object/class/method level
-The most widely used testing type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

What is integration testing

A

Integrating all individual components to form the final system - unexpected behaviour may arise

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

What is system testing

A

Testing the system as a whole, ensuring it doesnt impair performance on the wider environment such as the OS or other applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

What is user acceptance testing

A

-These plans are developed during the requirement analysis phase and are composed by users
-It is performed in a user environment that resembles the production environment and user realistic data
-Ensures the system meets the user’s requirements and system is ready for use in real time
-Validation rather than verification

55
Q

What are the advantages of UAT

A

-Highly structured
-Works well where all requirements are understood
-Simple to understand
-Easy to manage - each phase has an end review

56
Q

What are the disdvantages of UAT

A

-Once a project is in testing it is hard to go back to change functionality
-Not suitable for projects where requirements can change
-No working software created until late in the cycle

57
Q

What is static testing

A

Assessing documents

58
Q

What is dynamic testing

A

Testing that invloves executing a program

59
Q

What is white box testing

A

Testing where the internals of the program are known, so can test explicit paths through the system

60
Q

What is black box testing

A

Treats code as a black box, and therefore only concerned with functionality

61
Q

What is grey box testing

A

Know both the required functionality and also some implementation concepts which can be used in test design, but not code base exposed

62
Q

What are the advantages and disadvantages of white box testing

A

-Code can be seen so tests can be designed to test many paths through the programs
-However knowledge of the internals will influence the testing - can lead to bias in test design

63
Q

What are the advantages and disadvantages of black box testing

A

-No knowledge of internals therefore no bias and more likely to result in tests not expected by the programmer
-High probability tests will only test a small number of paths through the program

64
Q

What is code coverage and its types

A

Code coverage attempts to measure how much of the code has been tested. It looks directly at the code but is not black box testing.
-Function/method coverage
-Statement coverage
-Decision coverage
-Predicate coverage

65
Q

What is a corner case in testing

A

-Related to edge cases where a variable takes its max or min possible value
-Many variables at their extremes is said to be a corner case
-Helps to find situations where multiple extremes occur to find the more difficult bugs

66
Q

What are the limits of testing

A

-It is not possible to test every aspect of a system due to number of inputs and possible paths
-Testing cannot assert that the software functions correctly under all conditions, but that it function incorrectly under specific conditions

67
Q

What are the two event listeners and how do they work

A

-Polling: keeps checking to see if the event has happened, easy to implement but wasteful of resources
-Event-driven: has contact with the OS, waits to be notified when the event happens, complex to write but better use of resources

68
Q

What is the delegation model

A

Events are only distributed objects which register to listen for them

69
Q

What are the main components of event-driven

A

-Source: an object that generates an event - most often the some internal change of the source - and must register listeners for a listener to be notified
-Listener: an object that notified of an event occurring - must have registered and have methods to deal with notifications
-Event: an object that contains information about a state change in a source

70
Q

How does a class become notified of events

A

Implementing at least one listener interface

71
Q

What is the importance of unit testing

A

-Reduces time spent on debugging
-Helps communicate code’s intended use
-Code shouldn’t drift away from the limits put on them by the tests

72
Q

How do you prepare unit tests

A

-Decide how to test that aspect of the code
-May need to set up other instances of otehr methods if required
-Write the test code either before the implementation of the tested code or concurrently, not after
-Run the tests and ensure they pass

73
Q

What is Right-BICEP

A

-Right: are the boundary results right
-B: are the boundary conditions correct
-I: can you check the inverse relationships
-C: Can you cross-check the reults using some other means
-E: Can you force error conditions to occur
-P: Are the performance characteristics within bounds

74
Q

What are the properties of a good test

A

-Automatic
-Thorough
-Repeatable
-Independent
-Professional

75
Q

What are the guidelines for JUnit

A

-Each test will normally have multiple assertions
-If one of the assertions fails the test will exit
-When a bug is introduced only a few unit tests may fail making it easier to locate the bug
-Should not add code while tests are failing
-Fix any test as soon as they fail and keep tests passing as features are added

76
Q

What is a mock object

A

A cheap placeholder object that is predictable and allows one to test the method needed to in the current class

77
Q

When do you use a mock object

A

When the real object:
-has non-deterministic behaviour
-is difficult to set up
-has behaviour that is hard to trigger
-is slow
-has a user interface
-doesn’t yet exist

78
Q

How do you implement a mock object

A

-Use an interface to describe the object
-Implement the interface production code
-Implement the interface in a mock object unit testing

79
Q

What is a test suite

A

Groups multiple test classes to run as a single batch and can run a specific subset of unit tests from multiple test classes

80
Q

What is test-driven development

A

Code is seen from the user’s POV and can help to design code better

81
Q

What are invariants in testing

A

Assertions about classes/objects that should not change and should be tested when developing unit tests. Nee dto ensure an object can never be viewed in an inconsistent state

82
Q

What are design patterns

A

They provide a general reusable software solution to one type of problem during development. Theory is that a problem has already been solved, exploiting the work of others. Idea is to learn code patterns, experience reuse rather than code reuse

83
Q

What are the design pattern principles

A

-Identify aspects of the application that vary and separate them from what stays the same
-Program an interface not an implementation
-Favour object composition over class inheritance

84
Q

What are the types of design patterns

A

-Creational: object creation (factory, abstract factory, singleton)
-Structural: composition of classes and objects (decorator)
-Behavioural: intercation between objects (command)

85
Q

What is a factory pattern

A

Defines an interface for creating an object but lets subclasses decide which class to instantiate. It lets a class defer instantiation to subclasses

86
Q

What is an abstract factory pattern

A

Provides an interface for creating families of related or dependent objects without specifying their concrete classes

87
Q

What is the difference between factory and abstract factory

A

Factory uses inheritance and deals with creating objects of a single type giving an objetc in one shot, whereas abstract factory uses composition and returns a family of related classes

88
Q

What is a builder pattern

A

Separates the construction of a complex object from its representation so that the same construction processes can create different representations

89
Q

What are the different parts of a builder pattern

A

-Builder:Specifies the interface for creating parts of the object
-ConcreteBuilder: Create and assembles the parts that make the object througn the builder interface
-Director: Takes responsibility for the construction process of the object, but delegates actual creation and assembly to the Builder interface
-Product: The object that is created, consisting of multiple parts

90
Q

What are the benefits of the builder pattern

A

-Encapsulates the a complex object is constructed
-Allows objects to be constructed in a multistep and varying process
-Hides the internal representation of the product from the client

91
Q

What is a singleton pattern

A

Ensures that a class has only one instance and provides a global point of access to it The object can be resource hungry and not always used so a cost of implementation

92
Q

How do you create a singleton pattern

A

-Static member: Create a private static variable of the singleton class. This is the only instance of singleton class
-Private constructor: Create a private constructor for making sure an outer class cannot instantiate object from the singleton class
-Static public method: Create a global point of acess to get a singleton instance

93
Q

What is eager initialisation

A

The instance of singleton class is created a the time of class loading

94
Q

What is lazy initialisation

A

Ensures that the singleton instance is not created until the getInstance() method is called for the first time

95
Q

What is a thread safe singleton

A

The easier way to create a thread-safe singleton class is make the global access method synchronised, so that only one thread can execute this method at a time

96
Q

How is overhead avoided when making a thread safe singleton class

A

Double checked locking principle is used. The synchronised block is used inside the if consition with an additional check to ensure only one instance of the singleton class is created

97
Q

What is the decorator pattern

A

Attaches additional behavioural responsibilities to an object dynamically. Code is open for extension but closed for modification

98
Q

What is the command pattern

A

Encapsulates a request as an object allowing for the parameterisation of other objects with different requests, queue or log requests, and support undoable operations

99
Q

What are the components of a command pattern

A

-Invoker: holds a command and asks the command to carry out the request by calling its execute() method
-Command: declares an interface for all commands
-ConcreteCommand: defines the binding betwen an action and receiver. Once bound, the invoker can make a request of its command object
-Receiver: performs the work to carry out the request
-Client: responsible for instantiating the ConcreteCommand and setting its receiver

100
Q

What are Java generics

A

-Make bugs detectable at compile time therefore add stability to code
-Allows algorithms to be written for types to be specified at some point later
-Allows for code to be reused with different inputs

101
Q

What are the types of generics:

A

-Types (usually an uppercase letter)
-Methods
-Generics

102
Q

What is type erasure

A

-Ensures backwards compatability
-Compiler removes all type information from parameters and arguments within generic classes/methods
-Legacy type notation should not mix with generic types in newly produced code

103
Q

What is heap pollution

A

The situation when a variable of a declared parameterised type refers to an instance that is not of that parameterised type

104
Q

What is a collection and a map

A

-Collection: a group of objects known as elements
-Map a group of objects where each object maps keys to values

105
Q

What are the types of collections

A

-Set: contains no duplicate elements, two sets are treated equally if they contain the same elements
-List: An ordered collection of elements that may conatin duplicate elements, two lists are treated equal if they contain the same elements in the same order
-Queue: a collection of elements stored for processing, most concrete implementations use a first-in-first-out ordering
-Deque: A double-ended queue, insertions and deletion can be done at either end, with implementation similiar to queues

106
Q

What are the concrete sets

A

-HashSet: fastest but no order guarantees and has a hash table behind it
-TreeSet: uses a red-black tree structure, order based on value, slower than hashset
-LinkedHashSet: order based on set insertion, stored in a hash table with a linked list running through it

107
Q

What are the concrete lists

A

-ArrayList: typically fastest, but not always, uses dynamically resizing array
-LinkedList: doubly linked list implementation, better performing in certain cases

108
Q

What are the concrete map implementations

A

Similar to set implementations

109
Q

What is Java reflection

A

The ability for a class or object to examine itself and determine its structure

110
Q

What are some features of Java Reflection

A

-Find out what constructors, methods, and fields a class has, limits are imposed by JVM security manager
-Can change values of fields, dynamically invoke methods and construct new objects
-Cannot do things it could not do with ordinary compiled Java code, such as not accessing private fields unless given permission

111
Q

What is the similarity and differences between getFields() and getDeclaredFields()

A

Returns an array of field instances, however getFields() returns only public access modifiers and inherited ones, whereas getDeclaredFields() returns all variables regardless of access modifier and no inherited ones

112
Q

What is the difference between getConstructors() and getDeclaredConstructors()

A

The former returns public constructors where as the latter returns all constructors

113
Q

What does getMethods() do

A

Returns an array of all public methods associated with the class including inherited ones. Arguments can be passed through to return a Method relating to the specified method, which could be inherited

114
Q

Why is class.newInstance() worse than constructor.newInstance()

A

Both can create classes but
-The former can only invoke the no argument constructor, while the latter may invoke any constructor, irrespective of parameters
-The former requires that the constructor be visible, while the latter may invoke private constructors

115
Q

What are the uses of reflection

A

-Test programs by forcing specific states
-Insuring a high level code coverage in a test suite
-Debuggers can inspect running programs

116
Q

What is TCP

A

Transmission control protocol establishes point-to-point communication between two machines. It guarantees the order of data

117
Q

What is UDP

A

User datagram protocol is not connection based. Order is not guaranteed and neither is delivery. There is a lack of rror-checking and ordering overheads. It can recombine data in any order and it sends packets independent from one application to another

118
Q

What are ports

A

Allows data to be spent to different applications running on the machine. All data passed over the Internet has an address and a port associated with it. In TCP, a server application has a socket bound to a specific port. In UDP, the packet contains the port number and is routed

119
Q

What are sockets

A

In a server, it is bound to a particular port for a client to be able to make a connection request. The client needs a port to accept communication from the server. A new socket is set up so that teh can continue listening to request on the original socket

120
Q

What is Remote Method Invocation

A

Allows an object in one virtual machine to invoke methods on another object in another virtual machine.

121
Q

What does the server do in RMI

A

Makes some remote objects, generates accessible references to them

122
Q

What does the client do in RMI

A

Obtains a reference and invokes a method on it

123
Q

What is remote object location

A

Server application registers the remote objects with the RMI registry, pass remote object references via invocations of methods on other objects

124
Q

What is remote object communication

A

It is handled by RMI framework and looks like simple method invocation from programmer’s view

125
Q

What is accessing class definitions

A

RMI provides the ability for passing class definitions and object contents

126
Q

What are the components of Java RMI

A

-Registry: relates remote objects with names
-Server: calls the registry to bind a name with a remote object
-Client: looks up the remote object by its name in the server’s registry and invokes a method on it

127
Q

How do you create a distributed/remote service

A

-Make a remote interface (methods the client can call)
-Make a remote implementation (the concrete class implementation the interface)
-Use the Java compiler to generate client and server helpers automatically
-Start the RMI registry
-Start the remote service

128
Q

What is dynamic code loading

A

-A program can download a class definition along with the object reference
-Behaviours can be dynamically extended at runtime

129
Q

What are the 3 JVM class loaders

A

-Bootstrap: loads core Java libraries - written for efficiency
-Extensions: loads from the system wide, platform specific extension directory
-System: loads from the current directory and any specified in the CLASSPATH environment variable

130
Q

What are the 4 components of RMI architecture and what do they do

A

-Application layer: client and server program
-Stub & Skeleton layer: intercepts method calls made by teh client/redirects thses calls to a remote RMI service
-Remote reference layer: Understands how to intercept and manage refeences made from the clients to the remote service objects
-Transport layer: Based on TCP/IP connections betwen machines

131
Q

How is a remote object passed as an argument or returned as a result in any method invocation

A

By a reference

132
Q

Do clients of remote objects interact with remote interfaces or their implementation classes

A

They only interact with the remote interfaces

133
Q

How are non-remote arguments passed to and from RMI

A

By copying rather than by reference