Sobes.tech
Middle

What quality gates do you know?

sobes.tech AI

Answer from AI

Quality Gates are points in the software development lifecycle where a decision is made whether the product or its part has sufficient quality to proceed to the next stage.

Key quality gate criteria include:

  • Build stability: Successful compilation and absence of critical errors in the build.
  • Static code analysis results: Compliance with coding standards, absence of critical vulnerabilities or "code smells".
  • Test coverage: Sufficient coverage by unit, integration, and other automated tests.
  • Automated test results: Passing all or a specified percentage of automated tests (unit, integration, functional, regression).
  • Absence of critical defects: No blocking or critical bugs identified during testing.
  • Manual testing results: Successful completion of planned manual test scenarios and acceptance testing.
  • Compliance with requirements: The product functionally meets specifications and requirements.
  • Performance and scalability: Satisfactory results in load and stress testing.
  • Security: Passing security checks, including static application security testing (SAST), dynamic security testing (DAST), and penetration testing.
  • Documentation: Relevance and completeness of technical and user documentation.

Examples of metrics for Quality Gates:

  • Test coverage >= 80%
  • Number of critical bugs = 0
  • Automated tests success rate = 100%
  • Static code analysis score >= A

Example Jenkins Pipeline with Quality Gate:

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                script {
                    echo 'Building...'
                    // Call build script
                }
            }
        }
        stage('Static Analysis') {
            steps {
                script {
                    echo 'Running static analysis...'
                    // Integration with SonarQube or other tools
                }
            }
        }
        stage('Unit Tests') {
            steps {
                script {
                    echo 'Running unit tests...'
                    // Run unit tests and generate reports
                }
            }
        }
        stage('Quality Gate Check') {
            steps {
                script {
                    echo 'Checking Quality Gate...'
                    // Example of Quality Gate check with SonarQube
                    // wait-for-quality-gate abortPipeline: true
                }
            }
        }
        stage('Deploy to Staging') {
             when {
                // Condition to proceed to next stage, e.g., if Quality Gate passed successfully
                expression { return BUILD_STATUS == 'SUCCESS' }
             }
             steps {
                script {
                    echo 'Deploying to Staging...'
                    // Deployment steps
                }
             }
        }
    }
}
What quality gates do you know? — QA / QA Automation - sobes.tech