Software Development Flashcards
(212 cards)
What are characteristics of Waterfall software development approaches?
Waterfall is a linear and sequential approach to software development. Each phase must be completed before moving on to the next. It emphasizes documentation and is less flexible to changes once the project has started.
What are Characteristics of Agile software development?
Agile development is characterized by flexibility and collaboration. Scrum and Pair programming are indeed agile methodologies. User engagement is encouraged throughout the development process, and rapid delivery of a working product is a key principle of agile development.
How are static nested classes and inner classes accessed
Static nested classes are accessed using the enclosing class name, while inner classes are accessed using an instance of the enclosing class. This distinction is crucial in Java programming.
What are local classes
Local classes in Java are defined within a method. Their declarations can contain access modifiers such as public, and they can also access all members of the enclosing class instance.
What are anonymous classes
Anonymous classes in Java are declared without a class name. They can be defined both within and outside a method, but they are often used within methods for concise implementation of interfaces or abstract classes.
What are important aspects of multithreading in software development?
Multithreading involves the concurrent execution of multiple threads. Notable points include:
- A thread can be treated as a lightweight process.
- Every process has at least one thread.
- The operating system can run multiple threads virtually in parallel on a single processor.
- The operating system can run multiple threads actually in parallel on a multicore processor.
What defines race conditions in Java programming, and how can they be addressed?
Race conditions occur when two or more threads attempt to change data simultaneously. To address them:
- They happen when one thread tries to change data.
- They happen when two or more threads try to change data at the same time.
- They can be avoided by using either “synchronized” blocks or “synchronized” methods.
- They can be avoided through proper synchronization mechanisms.
What constitutes liveness problems in multithreading, and are they avoidable?
Liveness Problems in Multithreading:
Types:
Deadlock: Threads wait for each other indefinitely.
Livelock: Threads are actively trying to resolve a conflict but make no progress.
Starvation: Thread is perpetually denied access to a needed resource.
Priority Inversion: Higher-priority thread is blocked by a lower-priority thread.
Resource Deadlock: Similar to deadlock but involves non-lock resources.
Circular Wait: Threads wait for each other in a circular chain.
Mutex Locking: Overuse of mutex locks leading to contention.
Solutions:
Deadlock: Acquire locks in a consistent order, use tryLock() with timeouts.
Livelock: Introduce randomness or timeouts in retrying mechanisms.
Starvation: Adjust thread priorities, use fair locks, ensure fair resource access.
Priority Inversion: Use priority inheritance.
Resource Deadlock: Acquire resources in a consistent order, use timeouts.
Circular Wait: Establish a global order for resource acquisition.
Mutex Locking: Use fine-grained locking, lock-free structures, or alternative synchronization.
How do wait() and sleep() methods function in Java programs?
What stages define the lifecycle of a thread in Java programs?
he lifecycle of a thread in Java involves several states and transitions, such as:
(A) The thread scheduler selects a thread to go from the runnable to the running state.
(B) In the running state, a thread starts executing by entering the run() method.
(C) When an instance of the thread is created using the new operator, it is in the runnable state.
(D) The thread is alive when it’s in the waiting state.
What are the potential issues associated with stale data in software development?
Stale data in software development can lead to various issues such as:
(A) They may cause unexpected exceptions.
(B) They may cause corrupted data structures.
(C) They may cause inaccurate computations.
(D) They may cause infinite loops.
What Design Pattern does the Memento Pattern apply to?
Behavioral Patterns
What Design pattern does Iterator patterns belong to?
Behavioral Patterns
What Design pattern does Singleton pattern belong to
Creational Patterns
What Design pattern does decorator pattern belong to?
Structural Pattern
How do polling and event-driven programming differ in terms of event handling in Java?
Polling and event-driven programming have distinctive characteristics, including:
(A) Polling is easy to implement.
(B) Event-driven programming is more complex to implement than polling.
(C) Event-driven programming is wasteful of system resources.
(D) Polling is considered a much better use of system resources than event-driven programming.
Define polymorphism
Any code working with an interface can work with other classes that implement that interface
-An interface in the context of design patterns is a way to define a contract or a set of methods that a class must implement. It serves as a blueprint for classes that adopt it, ensuring consistency in behavior. Interfaces are essential components in many design patterns, promoting flexibility and polymorphism.
e.g.
public interface Shape { -
void draw();
}
-Any class that implements this interface must provide concrete implementations for method draw.
Note: in design patterns, we say “implement an interface” has a general meaning, not only implementing an interface, but also a concrete class implementing a method from a superclass.
What is a concrete class?
A concrete class is a class that provides a complete, tangible implementation of an interface or an abstract class. It can be instantiated, and it provides specific functionality based on the requirements defined by its superclass or implemented interface. Concrete classes play a crucial role in design patterns by realizing the contracts specified by interfaces or abstract classes.
What are the different levels of testing in software development?
Different levels of testing in software development include unit testing, which tests individual blocks of code; integration testing, which tests the entire system as a whole; system testing, which also tests the entire system as a whole; and user acceptance testing, ensuring that the delivered system meets user requirements.
How do white box and black box testing differ, and what are their characteristics?
White box testing may introduce bias in designing tests, and it allows designing tests to target specific paths through the program. In contrast, black box testing may also introduce bias, but it involves designing tests without knowledge of the internal code structure and focuses on testing the program’s functionality.
What factors should be considered when conducting unit tests in software development?
When performing unit tests in software development, it’s crucial to consider factors such as boundary conditions, inverse relationships, boundary results, and performance characteristics.
What qualities define good tests in software development?
Good tests in software development should possess certain properties: they should be automatic, repeatable, and contribute to comprehensive test coverage, ensuring that the testing process is efficient and effective.
What practices contribute to effective unit testing in software development?
Good practices of unit testing involve promptly fixing any failing tests, not continuing to add features to the code while tests are failing, and maintaining a disciplined approach to ensuring test integrity.
When should mock objects be utilized in software testing?
Mock objects are useful in software testing when dealing with real objects with non-deterministic behaviors, when the real object is challenging to set up, or when the real object does not yet exist.