This repository provides exercises for practicing software engineering techniques, including version control, code review, unit testing with Python, continuous integration, and agile methodologies.
1. Python
Python is a high-level, interpreted programming language known for its simplicity and versatility. It is widely used in software engineering for tasks such as unit testing, code analysis, and automation. The pytest
framework, used in this repository, is a popular testing tool in the Python ecosystem for writing simple and scalable test cases.
-
pytest
is a Python-based testing framework that simplifies writing small to complex test cases. It supports the development of unit tests by providing mechanisms for writing assertions, handling test fixtures, and generating test reports. Its ability to scale from simple functions to complex applications makes it ideal for ensuring code reliability and correctness.
2. Git
Git is a distributed version control system that tracks changes to files and allows multiple people to collaborate on a project. It enables users to manage and coordinate changes to the source code, ensuring that different versions of the code are maintained efficiently. Key operations include creating repositories, committing changes, and pushing to remote repositories.
3. Sphinx
Sphinx is a documentation generation tool designed to convert Python code comments (docstrings) into rich, accessible HTML documentation. It supports automatic API documentation and extensive formatting features, making it ideal for creating comprehensive documentation for software projects.
4. MkDocs
MkDocs is a static site generator specifically for project documentation. It emphasizes simplicity and markdown-based writing, making it easy to create well-structured documentation with minimal configuration. MkDocs is known for its clean, readable layouts and is used in various development environments to create professional documentation.
The unittest.mock
module in Python allows for replacing parts of a system under test with mock objects to simulate real-world behaviors. This technique is useful in unit testing when isolating the function under test by removing dependencies on external components or systems, ensuring that tests remain focused and independent.
dependency-injector
is a Python framework for implementing dependency injection, a design pattern that decouples the creation of dependencies from their usage. By injecting dependencies into objects rather than hard-coding them, this technique promotes flexibility, testability, and modularity in software design.
GitHub Actions and Travis CI are continuous integration (CI) tools that automate the building and testing of code whenever changes are pushed to a repository. CI pipelines ensure that code quality is maintained by running tests automatically after each commit, allowing teams to detect and fix errors early in the development process.
8. Codacy
Codacy is an automated code review tool that helps ensure code quality and maintainability by analyzing code for potential issues, code style violations, and complexity. It integrates with various version control systems and provides feedback on each commit or pull request to promote cleaner, more efficient code.
9. CodeFactor
CodeFactor is a code analysis tool that provides automated feedback on code quality by identifying style issues, potential bugs, and code complexity. It helps teams maintain high-quality code by integrating with GitHub repositories and providing real-time feedback on code changes. CodeFactor also supports code metrics and reporting for ongoing improvements.
This repository Software-Engineering organizes various experiments related to software engineering practices, each identified by its experiment number.
- Experiment Structure: Each experiment contains subfolders for:
- Source code
- Documentation
- Output files
- Experiment Examples:
- Experiment 1: Includes Python source and test code using
pytest
, documentation explaining the testing methodology, and a summary of the output. - Experiment 2: Focuses on Git operations, featuring relevant text files and output documentation.
- Experiment 1: Includes Python source and test code using
- Further Topics (Experiments 3 to 11):
- Documentation Generation: Using Sphinx and MkDocs.
- Practical Exercises: Including mocking, dependency injection, and code refactoring.
- Hands-on Learning: Jupyter notebooks for interactive learning.
- Continuous Integration: Experiment 7 addresses CI processes, with documentation related to GitHub Actions and Travis CI.
- Markdown Conversion: Markdown files have been converted to PDF format using md2pdf.
- Navigation: The structured approach facilitates easy navigation and understanding of the resources and outcomes related to each experiment.
Software-Engineering/
β
βββ Experiment 1/
β βββ Source Code/ π» # Contains Python source code related to unit testing using pytest.
| βββ Test/ π» # Contains Python test code related to unit testing using pytest
β βββ Documentation/ π # Includes word documentation explaining test cases and methodology.
β β βββ Pytest Unit Testing.docx
β βββ Output/ π # Holds Word document with output for Experiment 1.
β β βββ Experiment 1 Output.docx
β
βββ Experiment 2/
β βββ Documentation/ π # Contains text files related to Git operations and learning.
β β βββ Git Setup And Commands.txt
β βββ Output/ π # Holds Word document with output for Experiment 2.
β β βββ Experiment 2 Output.docx
β βββ Learning-Git Repo Content/ # Stores content from the associated Learning Git repository.
β β βββ repo_files/
β
βββ Experiment 3/
β βββ Documentation/ π # Example projects demonstrating Sphinx and MkDocs usage.
β β βββ Experiment 3 Commands.docx # Contains commands and procedures used in Experiment 3.
β βββ Experiment Output/ π # Holds Word document with output for Experiment 3.
β β βββ Experiment 3 Output.docx # Output from Experiment 3.
β βββ Example Documentation/ # Contains simple examples of output files.
β βββ MkDocs Pdoc Documentation/ # Documentation generated using MkDocs and Pdoc.
β βββ Sphinx Docstring Documentation/ # Documentation generated automatically using Sphinx.
β βββ Docstring Documentation/ π # Contains docstring documentation in markdown format.
β β βββ docstrings.md # Markdown file containing docstrings.
β βββ Output/ π # Word file containing the output from MkDocs and Pdoc tools.
β β βββ Experiment 3 Output.docx # Consolidated output for Experiment 3.
β βββ Reference Documents/ π # Additional reference materials or readings related to Sphinx and MkDocs.
β β βββ additional_readings.md # Contains further documentation regarding Sphinx and MkDocs.
β βββ Experiment Output Docstring Documentation # Contains the output and generated documentation for Experiment 3.
β βββ README.md π # Contains the Documentation for this folder
β
βββ Experiment 4/ π»
β βββ Mocking.ipynb # Jupyter notebook for mocking exercises.
β
βββ Experiment 5/ π»
β βββ Dependency Injection.ipynb # Jupyter notebook for dependency injection exercises.
β
βββ Experiment 6/ π»
β βββ Code Refactoring.ipynb # Jupyter notebook for code refactoring exercises.
β
βββ Experiment 7/
βββ Output/ π # Single Word document with output for CI processes.
β βββ Experiment 7 Output.docx
βββ GitHub Actions/ # Contains markdown and PDF documentation related to GitHub Actions CI.
β βββ Documentation/ π
β β βββ GitHub Actions Description.md
β β βββ GitHub Actions Description.pdf
βββ Travis CI/ # Contains markdown and PDF documentation related to Travis CI.
β βββ Documentation/ π
β β βββ Travis CI Description.md
β β βββ Travis CI Description.pdf
This experiment focuses on writing and executing unit tests for Python functions using the pytest framework. You will cover various test cases and assertions to ensure the correctness and reliability of your code.
This experiment involves practicing basic Git operations such as repository creation, file addition, committing changes, and pushing to a remote repository. You can find additional practice and details in the Learning Git Repository.
Write Python function and class docstrings to document code functionality. Students will then generate HTML documentation using tools like Sphinx or MkDocs. This exercise stresses the importance of maintaining clear and accessible code documentation.
4. Mocking
Practice the technique of mocking in Python using libraries such as unittest.mock
. Students will isolate and test individual components of a software system by replacing dependencies with mock objects, simulating real components in a controlled environment.
Explore the concept of dependency injection using libraries like dependency-injector
. This technique enables students to write flexible and testable code by decoupling the components from their dependencies, allowing easier integration and testing.
Identify and refactor code snippets to improve code quality, readability, and performance. Focus on techniques such as extracting methods, removing duplication, and improving naming conventions. This exercise aims to enhance the maintainability and efficiency of the code while adhering to best practices in software development.
Set up a basic continuous integration (CI) pipeline using tools like Travis CI or GitHub Actions. You can refer to additional resources in the Learning Travis CI Repository and Learning GitHub Actions Repository.
8. [Agile Sprint Planning](https://github.com/madhurimarawat/Agile-Sprint-and-Iris-Data-Explore
Conduct a simulated sprint planning session following agile principles, where students break down user stories into tasks, estimate their effort, and allocate them for a sprint. This exercise emphasizes collaboration, clear task definitions, and effective time management, preparing participants for real-world agile practices in software development.
Related Repositories:
9. [Code Review Automation]https://github.com/madhurimarawat/Software-Engineering/tree/main/Experiment%209)
Integrate a code quality analysis tool like CodeFactor or Codacy with GitHub to automatically analyze code changes and provide feedback on code style, complexity, and potential issues. This exercise helps students understand the importance of automated code reviews for maintaining code quality and streamlining the development workflow.
Related Repositories:
Conduct a simulated code review session where students provide feedback on each other's code, focusing on readability, maintainability, and adherence to coding standards. This exercise aims to cultivate constructive feedback skills, promote code quality, and reinforce best practices for collaboration among developers.
Pair up students to work on a programming task collaboratively, taking turns as the driver and navigator, and switching roles periodically to promote teamwork and knowledge sharing. This activity fosters communication, enhances problem-solving skills, and helps students learn from each other while improving code quality and development efficiency.
- Drop a π if you find this repository useful.
- If you have any doubts or suggestions, feel free to reach me.
π« How to reach me: Β Β Β - Contribute and Discuss: Feel free to open issues π, submit pull requests π οΈ, or start discussions π¬ to help improve this repository!