Essential Software Engineering Practices for Technical Leaders
Written on
Chapter 1: The Importance of Best Practices
In the realm of software development, engineers continuously adapt and adopt best practices from various disciplines. Mastering these practices and effectively integrating them into projects not only enhances the skillset of software engineers but also significantly increases the chances of project success.
As professionals grow in experience, the focus shifts on which best practices to prioritize. While junior developers often learn about unit testing and code cleanliness, senior engineers and technical leaders should concentrate on strategies that influence the overall project and development lifecycle.
Third-Party Library Management
- Maintain a registry of third-party libraries within the project's documentation space (Confluence, Wiki) and ensure regular updates by the technical lead or architect.
- Ensure compliance with the licensing agreements of any third-party libraries utilized.
- Instead of direct usage, incorporate third-party libraries via a facade design pattern to minimize tight coupling, allowing for easier replacements in the future.
- Conduct integration tests to cover third-party library code, ensuring that updates to the library do not disrupt application functionality.
- Opt for libraries that are actively maintained to ensure reliability.
Logging & Monitoring Practices
- Choose the most suitable logging level (Trace, Debug, Info, Warning, Error, etc.) for each logged message.
- Configure logging levels to be adjustable via configuration files without necessitating a code redeployment.
- Implement structured logging techniques to facilitate log analysis through query writing.
- Ensure that the transmission of logs to monitoring tools does not hinder application performance; utilize non-blocking logging and consider batch processing in separate threads.
- Utilize monitoring tools such as Application Insights or Stackdriver, configured to send alerts when certain application thresholds are exceeded.
In this insightful video, learn key strategies for software development managers and tech startups to improve their operations and team dynamics.
Code Review Best Practices
- Prioritize code reviews above development tasks to prevent lengthy pull requests.
- Automate the code review process using tools like GitHub, Crucible, or Review Board.
- Limit code review submissions to 300-400 lines, encouraging the division of extensive functionalities into smaller, reviewable segments.
- Allow reviewers to log the time dedicated to code reviews.
- Ensure that reviewers clearly understand the acceptance criteria for the code they are evaluating.
- Utilize a code review checklist available within the project space for all developers.
- Require at least one or two team members to review each commit before merging into the main branch.
Technical Debt Management
- Promptly create detailed technical debt tickets within the issue tracking system upon identifying tech debt.
- Organize technical debt tickets through epics, labels, or a consistent naming convention.
- Mitigate the accumulation of technical debt by incorporating a few related tickets into each sprint or allocating an entire sprint to address tech debt.
- Prioritize and estimate technical debt tickets during backlog refinement sessions.
- Ensure all stakeholders can easily locate technical debt tickets.
Estimation & Process Planning
- Involve the entire development team in estimations rather than limiting participation to just the technical lead or architect.
- Clearly define and publish the Definition of Done (DoD) for user stories in the project space, ensuring team consensus before estimations.
- Utilize 3-Point estimation or the PERT Formula instead of relying solely on single-value estimates.
- Include efforts for unit testing, code reviews, and testing activities in estimates.
- Employ techniques such as analogy-based estimation, story points, planning poker, and task decomposition during estimation.
- Regularly review and refine existing estimates during backlog grooming or sprint planning meetings.
- Engage all team members in the sprint planning process.
- Ensure all developers participate in the design phase, not just senior personnel.
- Delegate work through well-defined tasks by technical leaders.
- Establish written acceptance criteria for each task.
Source Code Management
- Store the project source code and all related scripts (database, build, deployment) in a version control system.
- Each commit should reference a work item ID from the issue tracking system along with a descriptive message.
- Developers should push changes to feature branches multiple times daily.
- Ensure that each commit addresses functionality pertaining solely to a specific work item.
- Merge approved pull requests into the main branch promptly to avoid conflicts.
- Exclude compiled binaries and third-party packages from source control by configuring the gitignore file.
- Keep environment-specific configurations, such as connection strings, separate from the source code, utilizing configuration files or environment variables.
- Define and document branching and merging strategies that suit the project's requirements within the project space.
Database Change Management
- Store database schemas and reference data in source control.
- Choose between state-based and migration-based approaches based on project needs.
- Always modify the database through scripts in source control; if changes are made directly, replicate them in source control.
- Each developer should maintain a local database that can be easily created using repository scripts.
Continuous Integration and Delivery
- Document the continuous integration workflow and share it with the team.
- Include a static code analysis tool in the continuous integration pipeline, ensuring builds fail if code quality metrics fall below standards.
- Ensure the continuous integration pipeline runs all unit tests, causing builds to fail if any tests do not pass.
- Encourage developers to run unit tests locally before committing code to the repository.
- Configure build notifications so the build server alerts relevant parties about build status.
- Implement semantic versioning for build artifacts.
- Associate each build with its corresponding repository commit.
- Define and configure rollback procedures for failed deployments.
Code Quality Assurance
- Regularly collect and analyze code quality metrics to swiftly identify and address code issues.
- Ensure all team members utilize the same static code analysis tool with uniform configurations as that of the build server.
Consider subscribing to my Telegram channel, Software Development Daily, for more insights and articles.
In this video, Nicky Thompson discusses effective software engineering practices to enhance management, offering valuable insights for technical leaders.