Everyone loves a satisfied customer (especially our sales team, since that's how we get our salaries!). But how do we make customers happy? How do we capture requirements properly for developing good software? That is what we will learn today.
Rajesh, the proud owner of a bustling sweet shop on 56 Dukan Street in Indore, is struggling to manage his inventory due to the recent increase in consumer demand and limited staff. Frustrated with the inability to handle numerous orders, Rajesh reaches out to GreatSoftwareSolutions.Inc in search of a solution.
"Every day we are losing customers since our staff is not able to handle so many orders. Can you help us in managing our orders and inventory?" Rajesh pleads with a heavy voice.
"Don't worry, Rajesh. You have come to the right place. In fact, we already have a solution ready for you. Have a look," Vikas from sales replies with a confident voice.
class MySweetShop {
private OrderService orderService;
private Map<String, Integer> inventory = new HashMap<>();
public MySweetShop(OrderService orderService) {
this.orderService = orderService;
}
public String placeOrder(String sweetName, int quantity) {
if (inventory.containsKey(sweetName) && inventory.get(sweetName) >= quantity) {
inventory.put(sweetName, inventory.get(sweetName) - quantity);
int orderId = orderService.placeOrder(sweetName, quantity);
return "Your order id is " + orderId + ". Please collect it from the counter.";
} else {
return "Sorry, we are out of stock. Please come tomorrow.";
}
}
// other methods
}
Relieved to have found a solution, Rajesh thanks the team and begins using the inventory management app in his shop. Everything runs smoothly until Rajesh hurries back to GSS.Inc's office a few days later, with a sense of urgency.
"There's some problem with the system. Our customers are not able to order our best-selling Indori special chaat," Rajesh explains, frustrated with the setback.
Tip: Think about what could have gone wrong here before reading further!
This is what happens when you don't listen to your customers properly. Always remember, the first principle for building a great software product is that Great Software fulfils customer expectations, no matter how big or small. In the software development life cycle, this step of capturing the expectations and requirements of your customers is known as Requirement Gathering.
In software engineering, A requirement is a statement that describes what a software system must do or how it should behave in order to satisfy stakeholders’ needs and expectations.
Requirements can be divided into two categories:
One effective way to capture requirements is to use a structured approach such as the user story mapping technique. This involves identifying and organizing user stories based on the different user roles and goals and then prioritizing them based on their importance and feasibility.
User Stories for VSS:
Using these user stories as a basis, we can then identify the corresponding functional and non-functional requirements for the system, such as:
Notice how writing the user journey also helps us design the system. In this case, our application caters to two different sets of users. From a design perspective, it makes sense to build the product with clearly defined system borders between the two groups. These different sets of requirements delivered by your software system are also commonly known as use cases.
In software development, A use case outlines how a system interacts with users or other systems to achieve a specific goal. It defines the steps involved and the expected inputs and outputs for that goal.
Use cases are critical in the requirements-gathering process. They help ensure that the system meets the needs of end-users and stakeholders by providing a clear understanding of how the system will work in real-world scenarios.
Few examples:
Use case: Deliver an order to the customer
Input: Order Id, Item Quantity, Item Type
Output: Packaged items of given quantity
Happy Path:
1. Validate order id.
2. Fetch Items
3. Package Items
4. Deliver items to reception area.
Use case: Assist Customer with Order Placement
Input: Customer Query
Output: Order Id
Happy Path :
1. Prompt customer for a query
2. Search Inventory for availability of queried item.
3. Prompt user for payment
4. Provide user with an order Id.
Use case: Authenticate a user
Inputs: Username and password
Outputs: Access to protected resources
Happy path:
1. User enters their username and password.
2. System verifies the credentials.
3. System grants the user access to protected resources.
In conclusion, gathering requirements is a critical step in building great software products. It involves capturing and organizing user stories and identifying corresponding functional and non-functional requirements for the system. By listening to customers and using a structured approach such as user story mapping can help ensure that all important requirements are identified and prioritized.
So always remember the first principle for building a great software product: Great Software fulfils customer expectations, no matter how big or small. Enjoy learning, enjoy software engineering!
If you have any queries/doubts/feedback, please write us at contact@enjoyalgorithms.com. Enjoy learning, Enjoy oops design, Enjoy algorithms!
Subscribe to get well designed content on data structure and algorithms, machine learning, system design, object orientd programming and math.