One of the primary responsibilities of an Advanced Certified Scrum Developer (A-CSD) is to address and manage issues that arise in a software development project. This sometimes involves dealing with missing or resource inefficient components or subsystems within the project.
When dealing with missing or resource inefficient components or subsystems, there are a multitude of techniques that can be applied. Some of these techniques may include refactoring, mocking, and stubbing.
Refactoring
Refactoring is the process of improving the design of existing code without changing its external behavior. It’s a disciplined way to clean up code that minimizes the chances of introducing bugs. In terms of dealing with missing or resource inefficient components or subsystems, refactoring involves adapting or enhancing the existing parts of the code base to ensure an efficient system.
Consider this a simple example. Let’s assume that we have a software subsystem or component that retrieves data from a database and uses it throughout the system. However, the component takes too much time to respond because it retrieves data every time it is invoked.
class DataRetriever:
def __init__(self, db):
self.db = db
def retrieve_data(self):
data = self.db.query("SELECT * FROM table")
return data
By refactoring, we could change the code to retrieve data once and store it in a variable, then just return this variable if the data is already loaded.
class DataRetriever:
def __init__(self, db):
self.db = db
self.data = None
def retrieve_data(self):
if not self.data:
self.data = self.db.query("SELECT * FROM table")
return self.data
This simple refactoring could drastically increase the performance of the component by reducing the number of database queries.
Mocking
In addition to refactoring, another technique that could be used to deal with missing components or subsystems during the development process is mocking. This technique is commonly used in unit testing where the unit test requires certain behaviors or states from dependencies.
A mock is a fake object in the system that simulates the behavior of real objects. Mocking is mainly used in unit testing. An object under test may have dependencies on other (complex) objects. To isolate the behavior of the object you want to test, you can replace the other objects by mocks that simulate the behavior of the real objects.
Consider this simple example:
class FileDownloader:
def __init__(self, url):
self.url = url
def download_file(self):
# complex logic to download file
pass
While writing a unit test for FileDownloader, having a real file to download might be unfeasible or costly. In this case, we can use a mock object to simulate the behavior of a real file.
class MockFileDownloader(FileDownloader):
def __init__(self, url):
self.url = url
def download_file(self):
return 'sample data'
Using MockFileDownloader in our unit test allows us to replicate and test the behavior of FileDownloader without the need to download an actual file.
Stubbing
Similarly to mocking, stubbing allows us to deal with missing components by providing canned answers to calls made during the test. Essentially, a stub is a controllable replacement for an existing dependency (or collaborator) in the system.
Consider the following example:
class WeatherService:
def get_current_temperature(city):
# implementation to get current temperature
pass
class WeatherApp:
def __init__(self, weather_service):
self.weather_service = weather_service
def show_current_temperature(self, city):
temp = self.weather_service.get_current_temperature(city)
print(f"Current temperature in {city} is {temp} degrees.")
In unit tests for WeatherApp, if WeatherService is not ready yet or is slow and unreliable, we can replace it with a stub that provides predefined weather data.
class StubWeatherService(WeatherService):
def get_current_temperature(self, city):
if city == 'London':
return 20
else:
return 25
stub_service = StubWeatherService()
app = WeatherApp(stub_service)
app.show_current_temperature('London') # prints "Current temperature in London is 20 degrees."
In this case, StubWeatherService operates as a placeholder until the real service is ready to be integrated, or as a simpler, more efficient substitute for the real service in tests.
It is noteworthy to mention that the judicious application of all these techniques is key to ensuring that they aid rather than impede the project’s progress. As an A-CSD, understanding when and how to employ these strategies is paramount to efficient project execution.
Practice Test
True or False: Incorporating redundancies is one technique to deal with missing or resource inefficient components.
- Answer: True
Explanation: Redundancy, which duplicates certain parts or functions, can provide an avenue for continued functionality in the event of failures in a system or component.
Which one of the below is NOT a technique to handle missing components or subsystems in Scrum?
- a) Developing a stub
- b) Developing a Mock
- c) Using Redundancies
- d) Ignoring the problem until it becomes critical
Answer: d) Ignoring the problem until it becomes critical
Explanation: Ignoring the problem will only exacerbate it in the long term. The other options are proactive approaches to managing missing components or subsystems.
Multiple select: Which of the following are techniques to manage resource-inefficient components in Scrum?
- a) Load balancing
- b) Code refactoring
- c) Ignoring the issue
- d) Performance testing
Answer: a) Load balancing, b) Code refactoring, d) Performance testing
Explanation: These techniques can help identify, isolate and rectify the inefficient components in order to improve overall resource utilization or system performance.
True or False: Mock objects are a technique to deal with missing subsystems, often used in unit testing.
- Answer: True
Explanation: Mock objects simulate the behavior of real objects in controlled ways and are often used as placeholders for missing components during testing.
Single select: Which technique is usually employed to handle missing components in a system?
- a) Complete replacement
- b) Ignoring problem
- c) Develop a stub
- d) None of the above
Answer: c) Develop a stub
Explanation: Developing a stub is a proactive approach to substitute missing components until they become available.
True or False: Using redundant components in a subsystem is a inefficient approach.
- Answer: False
Explanation: Redundancy is a common and effective approach to ensure backup and continued functionality even when a component fails.
Multiple select: As a Certified Scrum Developer, which of the following techniques will you employ to deal with resource inefficient components?
- a) Performance testing
- b) Code refactoring
- c) Avoiding the components in development
- d) Making use of load balancing
Answer: a) Performance testing, b) Code refactoring, d) Making use of load balancing
Explanation: Avoiding the components in development is not a solution. Performance testing, code refactoring and load balancing are proper techniques used to deal with resource-inefficient components.
True or False: Ignoring missing components or subsystems is considered a good practice in scrum development.
- Answer: False
Explanation: Ignoring missing components can create bigger issues down the line. It’s better to handle these issues proactively.
Single select: Which of the following is not considered a good practice to handle missing components in scrum?
- a) Developing a mock
- b) Developing a stub
- c) Ignoring the problem till last minute
- d) Incorporating redundancy
Answer: c) Ignoring the problem till last minute
Explanation: Ignoring problem till last minute could result in a severe impact on the system.
True or False: Load balancing is a technique to manage resource inefficient components in Scrum.
- Answer: True
Explanation: Load balancing is a technique that distributes workloads across multiple computing resources to optimize resource use, maximize throughput, and minimize response time.
Interview Questions
What is data imputation in the context of missing data?
Data imputation is a method used to handle missing data by estimating missing values based on other available data.
When applying techniques to deal with missing data, what is a simple and common method?
A common and straightforward method is Listwise deletion. It involves removing entire observations where any single value is missing. However, it can lead to biased results if the missing data is not purely at random.
What risk is involved in using a mean substitution to deal with missing data?
The major risk with using mean substitution is that it can lead to an underestimate of errors, as it doesn’t consider the inherent error in measures. This can potentially distort any statistical analysis.
How can regression imputation be used to deal with missing data?
Regression imputation involves using multiple regression to predict missing values. It uses the relationships between the missing variable and other variables to estimate what the missing value should be.
How can a tester in a Scrum Team identify resource inefficient components?
Testers in a Scrum team can identify resource inefficient components using tests such as load testing, stress testing, and performance testing. These tests stress the system to identify components that don’t perform well under load or use too many resources.
How are missing subsystems and components categorized in the development process of Scrum?
Missing subsystems and components are typically categorized as “Technical Debt” in the development process of Scrum. It’s crucial to manage, mitigate, and eventually eliminate this debt to avoid further complications in the future.
What is a recommendation for dealing with missing components or subsystems in Scrum?
One recommendation is to use a stub, a piece of code used to mimic the functionality of the missing component, until the actual component is developed. This enables the teams to continue their work and test without disruption.
Why is efficient resource usage an important concern in a Scrum project?
Efficient resource usage is key to delivering the project timely and in the anticipated budget and quality, thus making it a priority in Scrum projects.
What is one technique to improve the efficiency of program code in Scrum?
One technique is refactoring, which involves modifying the existing code without changing its external behavior. It can make the code more readable, maintainable, and efficient.
What is Pair Programming and how can it contribute to deal with missing or resource inefficient components in Scrum?
Pair programming is a technique where two programmers work together at one workstation, with one writing the code and the other reviewing each line of code as it’s typed in. This dual view helps in catching errors in early stages, which can lead to improved coding efficiency and reduced missing or inefficient code components.
What are the potential benefits of the Code review in dealing with missing or resource inefficient components in Scrum?
Code review ensures that the code is understandable, clean, and efficient. It can help identify missing components, inefficient algorithms, or unnecessary lines of code, thus resulting in better performance and lower technical debt.
How can Test-Driven Development (TDD) help deal with inefficient components in Scrum?
TDD promotes better design, higher quality of code and efficient components by ensuring that programmers think through their design before they write their code. By writing the test cases first, the developers are essentially forced to think of all necessary components, which can lead to a more efficient design.
What is the benefit of Continuous Integration in dealing with missing or resource inefficient components in Scrum?
Continuous Integration encourages developers to share their code and unite their changes with a shared mainline, leading to early detection of conflicts or missing components. This frequent process helps in identifying problems early and makes diagnosing and fixing of issues quicker to achieve resource efficiency.
How does the use of Agile Modeling techniques contribute to deal with missing or resource inefficient systems or components in Scrum?
Agile Modeling techniques like Light Weight Design or UML can help teams avoid over-engineering and maintain a straightforward design, thus aiding in the construction of efficient systems and minimizing the risk of missing components.
What is the use of ‘A Spike’ in Scrum to deal with missing or resource inefficient components?
Spike is a user story that cannot be estimated until a development team runs a time-boxed investigation. It is used to explore potential solutions or new technologies, and allows developers to understand potential issues or inefficiencies of a system, or missing components. The knowledge gained can then be used to split the spike into smaller, more estimable user stories.