SDLC (1) Sadia
SDLC (1) Sadia
Requirement Gathering: This phase involves gathering and documenting the specific needs and
expectations of the stakeholders. For example, you could discuss how a team interviewed users,
analyzed existing systems, and used various techniques like surveys and questionnaires to gather
requirements for a new software application.
Requirement Analysis: In this phase, the collected requirements are carefully analyzed and
organized. You can provide an example of how a team might use use-case diagrams, flowcharts,
and data models to understand and document the functional and non-functional requirements of
the project.
Prioritization: Once requirements are gathered, they need to be prioritised to determine what
should be addressed first. A practical example could be discussing how the team categorized
requirements as "must-haves," "should-haves," and "nice-to-haves" to guide project planning.
Development: This phase involves the actual coding and development of the software. You can
provide an example of how developers write code, create databases, and design the user interface
based on the requirements and design specifications.
Unit Testing: During development, individual components or units of code are tested in isolation
to ensure they work as expected. For instance, you can mention how developers write test cases
to verify the correctness of a specific function or module.
Integration Testing: In this phase, the developed units are integrated and tested together to ensure
they work as a cohesive system. You can discuss how various modules or components are
combined and tested for compatibility.
Deployment to SIT (System Integration Testing): At this point, the software is deployed in a
controlled environment for system-level testing. You can explain how this environment simulates
the production environment, and how system-level tests are performed to identify and fix
integration issues.
Manual Testing: This is when manual testing is conducted to ensure that the software meets the
specified requirements. You can provide examples of test cases that are executed by testers to
identify bugs or issues.
End-to-End Testing: This phase involves testing the entire software system, including all
integrated components, to ensure that it functions as expected in a real-world scenario. You can
give an example of how this phase validates the software's ability to handle typical user
scenarios.
Production: Once all the testing and validation are complete, the software is deployed in the
production environment for actual use by end-users. You can mention that this phase marks the
official launch of the software.
Example:
Creating a complete software project with code and visualization for every step of the Software
Development Life Cycle (SDLC) is beyond the scope of a single response, as it can be quite
extensive. A simplified example of a web application development project that goes through
each phase of the SDLC. I'll include code snippets and descriptions for each step. Please note
that this is a highly simplified example, and real-world projects are usually more complex.
Scenario: Building a simple "To-Do List" web application using HTML, CSS, and JavaScript.
Requirement Gathering:
Requirement Analysis:
Prioritization:
Development:
Create HTML, CSS, and JavaScript files for the web application.
html
Copy code
<!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<title>ToDo List</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>ToDo List</h1>
<ul id="taskList">
<!-- To-Do tasks will be dynamically added here -->
</ul>
<input type="text" id="taskInput" placeholder="Add a task">
<button onclick="addTask()">Add</button>
<script src="script.js"></script>
</body>
</html>
css
Copy code
/* style.css */
/* Styles for the ToDo List */
h1 {
text-align: center;
}
Unit Testing:
Integration Testing:
Ensure that HTML, CSS, and JavaScript are integrated and work together.
Manual Testing:
Production:
A simplified another example of how you might progress through each step of the Software
Development Life Cycle (SDLC) for the e-commerce platform project.
Scenario: Your team is developing an e-commerce platform. You are currently in the
Requirement Analysis phase.
Requirement: "The platform should allow users to browse products, add them to their cart, and
make secure payments."
Step 2: Requirement Analysis
Now, you analyze and organize the requirements. For the given requirement, you might create a
use-case diagram, which helps you visualize how users will interact with the system:
Step 4: Development
In the Development phase, you create HTML, CSS, and JavaScript files to implement the
platform. Here's a simplified code snippet for adding a product to the cart in JavaScript:
javascript
Copy code
// JavaScript for adding a product to the cart
function addToCart(product) {
// Logic to add the product to the user's cart
}
Step 5: Unit Testing
You write unit tests for the addToCart function to ensure it works correctly. For example
javascript
Copy code
// Unit test for the addToCart function
function testAddToCart() {
// Test if the function adds a product to the cart
// and updates the cart correctly
}
Step 6: Integration Testing
In this phase, you ensure that the product listing, cart management, and payment processing
components work together correctly.
CODE ARCHITECTURE
● Space-based architecture - many websites are built around a database, and they
function well as long as the database is able to keep u with the load. But when
usage peaks and the database can’t keep up with the constant challenge of
writing a log of the transactions, the entire website fails.
package com.viewfromthecodeface.procedural;
import java.util.Scanner;
public class GuessMyNumber {
private final int numberToGuess;
public GuessMyNumber(int numberToGuess) {
this.numberToGuess = numberToGuess;
}
if ( latestGuess == numberToGuess ){
guessedCorrectly = true ;
}
else {
display("Try again");
}
attemptNumber++;
}
return guessedCorrectly;
}
package com.viewfromthecodeface.procedural;
public class Main {
The main method is trivial. It creates a GuessMyNumber object and supplies it with our secret
number.
It then calls play() to run the game.
The code is short. It’s reasonably clear and readable. And it works.
What’s not to like?
To display to a GUI, we would have to rip out the innards of the display() method.
We would need it to write to a JTextArea – or something from JavaFX.
This would need main windows created, and other modifications to the code.
It’s not ideal.
We’ve built and manually tested this thing. Now we’re going to invalidate that.
The big problem with changing the input and output sources is also the problem with testing.
If we could change the input and output sources easily, then we could write a unit test using
stubs.
Stubs are simple Java objects that let us ‘pretend’ to be the real objects:
● We can simulate keystrokes in Java, without messing around with the real keyboard
● We can simulate a console – and capture the program output as simple Java strings.
Using these ideas, we can write a fast, not-flaky Unit Test.
Our program’s real problem is that it depends on the System.scanner for input and
System.out.println for output.
Our code creates and uses the objects directly.
What if we turned that upside down?
What if we made the code so that it didn’t depend on these objects, but instead, provide a way to
plug them in later?
This trick is called dependency inversion.
Hexagonal
package com.viewfromthecodeface.hexagonal.adapters;
import com.viewfromthecodeface.hexagonal.domain.Display;
package com.viewfromthecodeface.hexagonal.adapters;
import com.viewfromthecodeface.hexagonal.domain.Guesses;
import java.util.Scanner;
package com.viewfromthecodeface.hexagonal.domain;
package com.viewfromthecodeface.hexagonal.domain;
if ( guesses.latestGuess() == numberToGuess ){
guessedCorrectly = true ;
}
else {
display.show("Try again");
}
attemptNumber++;
}
return guessedCorrectly;
}
package com.viewfromthecodeface.hexagonal;
import com.viewfromthecodeface.hexagonal.adapters.ConsoleDisplay;
import com.viewfromthecodeface.hexagonal.adapters.KeyboardGuesses;
import com.viewfromthecodeface.hexagonal.domain.Display;
import com.viewfromthecodeface.hexagonal.domain.Guesses;
import com.viewfromthecodeface.hexagonal.domain.HexagonalGuessMyNumber;
https://www.viewfromthecodeface.com/portfolio/clean-code-hexagonal-architecture/
https://radixweb.com/blog/software-architecture-patterns