Software Development Flashcards
What does the SDLC represent?
The development of software as phases or sets of activities
What causes the SDLC?
The desire to define a predictable process to improve quality
What does the SDLC involve?
Creating processes that can be effectively managed
What are the 5 broad categories of the SDLC?
- Requirement Analysis
- Design
- Implementation
- Testing
- Evolution
What is Requirement Analysis?
What business/scientific problem is the system addressing?
What will the system do? Who are the users?
What is Design?
Hardware, software and network requirements
What parts are in-house, and what is externally developed or bought of the shelf
What is Implementation
The process of turning a software design into a working system by writing code, integrating components, and deploying it for use.
What is Testing?
The process of evaluating software to ensure it works as expected, is free of bugs, and meets user requirements.
What is Evolution?
Has system accomplished its goals, are there any modifications
Also includes maintenance of the system
What are the 4 Software Development Methodologies?
- Waterfall
- Prototyping
- Rapid Application Development
- Agile Development
What is a Waterfall?
Breaks process down into distinct sequential phases
- Each phase needs sign-off befoore moving to the next
- Leads to very well documented projects
What is Rapid Application Development?
A fast, flexible software development method that emphasizes user feedback, quick iterations, and prototyping over extensive planning.
- Often development deadlinne prioritised over requirements.
What is Agile Development?
A flexible, collaborative software development method focused on delivering small, functional pieces of software quickly and adapting to change.
What is Prototyping?
Creating a simplified, working model of the software to test ideas, gather feedback, and refine before the final version is built.
What are the advantages of Agile Development
- User engagement
- Rapid Development of a usable product
- Early testing catches bugs and results in a high quality product
- Small incremental changes mitigate potential risk of introducing large change to system
What is a Scrum?
A framework within Agile development that organizes work into short, focused cycles called sprints (typically 2-4 weeks) to deliver small, workable software increments.
What is a Sprint planning meeting?
Part of a scrum that focuses on:
- Which items will be worked on
- Identify sprint tasks
- Divide the sprint into timeboxes
What is a Daily scrum meeting?
Part of a scrum that focuses on:
- Summarising previous day’s work and coming day’s work
- Intended to foster collaboration
What is a sprint review meeting?
Part of a scrum that focuses on:
What are the advantages of OOP?
- Encapsulation/information hiding
- Inheritance
- Polymorphism
What is the difference with OOP in comparison to procedural programming?
Puts code into objects, in contrast to procedural programming where no relationships are defined for each entity.
What should classes in OOP include and how does encapsulation sometimes cause issues?
- Classes in OOP should usually be specified to include only code
related to their specific function. - Encapsulation can cause issues with tightly coupled classes that rely
heavily on each other’s members. - This creates a lot of work in designing functions to access those -
members. - These issues are more common in GUI programming.
Define a Nested Class
Classes defined within classes
What are two types of Nested Class?
- Static nested class
- Inner class
What modifiers can be used for standard outer classes and nested classes in Java?
Standard outer classes (top-level classes) can only be declared with two modifiers:
- public
- default (package-private)
Nested classes can be declared with any of the standard modifiers:
- public, private, protected, or package-private.
What is the main difference between Static Nested Class and Inner Class?
Static nested class (doesn’t have access to instance members)
Inner class (does have access to instance members)
Why use nested classes?
- Closely linked classes can be located in one place for better
organization. - If one class is only used by another, making it a nested class makes
this relationship explicit. - Increases encapsulation by controlling visibility:
- If the Engine class is nested inside the Car class, the private
members of Car are visible to Engine.
- If the Engine class is nested inside the Car class, the private
- Can also improve code readability.
List 4 key features of Inner Classes
- Can be difficult to spot in code
- Will produce two class files on compilation
- Inner classes can be directly accessed by the enclosing instance
- All nested classes can be accessed externally through either the containing class or object
How does the scope with inner classes work?
“this” refers to the inner type instance
“OuterClass.this” refers to the instance of the surrounding (outer) class, when within the inner class code blocks.
What are local classes?
Local classes are defined and exist solely within a block (usually a method)
What can’t local class declaration contain?
Cannot contain public, protected, private, or static.
What can local classes access and not access?
Can access all members of outer class instance like standard inner class member
Cannot access method local variables unless they are declared as final
Define an anonymous class
Classes that are declared without any class name at all
How can anonymous classes be defined?
Not only may these be defined within a method, they may also be defined within an argument to a method.
Define Concurrency
To be able to perform multiple processes at same time
Each process happens in parallel without having to wait for each other to be scheduled
(including the potential interaction between them)
What is multiple tasks at the same time called?
Parallelism
Why is concurrency important?
Most efficient use of hardware - gets the most out of the processor and its cores
What is a thread?
Can be treated as lightweight processes
Threads exist within a process
Why use threads instead of separate programs?
Easier to manage multiple threads under a process than have multiple different programs
What is Multi-threading
OS can run threads in parallel
- Virtually, on a single core processor
- Actually, on a multi-core processor
Define Nondeterminism
Where the exact order in which processes are executed cannot be predicted
What causes Nondeterminism?
Multiple tasks are running at the same time, and the OS may decide to swich between them at different moments
What is Liveness?
Being concerned both when code doesn’t perform correctly and that code performs correctly in time
What are the 2 ways threads can be created in Java?
- Using the Thread class
- Using the Runnable interface
How to stop a Thread?
- Setting a flag
- Interrupting
What are Race Conditions?
When two threads try to access/change data at the same time
Define an Atomic Action
In programming, atomic actions are self-contained, they can’t be stopped in the middle
- They either happen or don’t
What is Deadlock?
When thread 1 needs a resource in thread 2, and thread 2 needs a resourse in thread 1
This creates a deadlock and nothing happens as to run they both require resources from each other, creating an infinite cycle - deadlock
Define Starvation
Where a thread can’t gain regular access to shared resouces because another thread is frequently calling the objects methods
Define Livelock
Similar to deadlock, except that it occurs when 2 threads are too busy responding to one another to work
What does wait() do?
Releases the lock and regains it using the notify()
What is the difference between Wait and Sleep?
Wait
- Must occur in block synchronised on the monitor object
- Releases the monitor (lock) when called; doesn’t sacrifice the remainder of its time slice
- Will wake up if notified via call
Sleep
- Doesn’t need to occur in a synchronized block
- Retains the monitor (lock) when called and sacrifices the remainder of its time slice
- Can only be woken up by an interruption (not by notify)
What is a Thread lifecycle?
Thread needs to wait to start until the start method is invoked goes between runnable and running, this is dependent on the OS
What is Yield()?
Identifies the current thread as doing something not particularly important
How does Yield() work?
Causes the currently executing thread object to pause and allow other threads to execute
If no other threads of the same priority need to execute, the thread continues.
What is Join()?
Allows one thread to wait for the completion of another
How to stop a Join()?
Like sleep, responds to an interrupt
What is important about the data threads access?
Need to ensure the data our threads are accessing is fresh (up to date)
Stale data can lead to large issues
What are Atomic Variables?
Variables that support atomic operations, ensuring that increments, decrements or reads happen as a signle uninterruptible action
Explain volatile & data freshness
Declaring a variable volatile tells the compiler not to optimize accesses and forces the next read to see the last write