Facebook Twitter Instagram
    Trending
    • A New Eruption of Iceland’s Fagradalsfjall Volcano
    • FTX CEO Among Those Backing NFT-Leveraging Media House
    • How to set up and use Apple AirTags to find lost luggage
    • Air Canada Illegally Flouting Customer Compensation Rules
    • Researchers unravel the mechanism of teixobactin at the atomic level
    • Anne Heche under investigation for DUI, hit and run following fiery crash, say police
    • 5 Ways of Sorting Full-Text Search Results in MongoDB | by Sifeddine Lamraoui | Aug, 2022
    • Villa Trompenberg / Engel Architects
    Facebook Twitter Instagram YouTube
    Swave Digest
    • Home
    • World News
    • Technology
      • Smartphones
      • Computers
      • Programming
      • Automobiles
    • Entertainment
      • Music
      • Anime
      • Movies
    • Sports
      • Football
        • Premier League
      • Basketball
      • Tennis
    • Business
      • Crypto
      • Stocks
      • NFT
    • Lifestyle
      • Fashion
      • Health
      • Travel
    • Shop
    Swave Digest
    Home»Technology»Programming»Fitness Functions for Evolving Architecture
    Programming

    Fitness Functions for Evolving Architecture

    Swave DigestBy Swave DigestJune 14, 2022No Comments3 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Fitness Functions for Evolving Architecture
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Table of Contents

    • Introduction to fitness functions concept with simple examples
    • Architecture constraints tests
    • Architecture design tests
    • Architecture and operation tests
    • Security tests

    Introduction to fitness functions concept with simple examples

    Fitness Functions for Evolving Architecture ShareASale 336x260 A
    A person doing fitness exercises
    Photo by Jason Briscoe on Unsplash

    In this article, I’m going to introduce the fitness functions concept and provide a few simple examples. By the end of the article, you’ll get an idea of what these functions are used for. Hopefully, you’ll gather fresh ideas about testing your project’s requirements.

    Fitness functions are used to measure how close the architecture comes to achieving a goal. They guide us through the evolution of the system.

    The software architecture considers crucial requirements such as performance, reliability, security, operability, coding standards, etc.

    For example, we can write tests or metrics to meet the required criteria. Consider a business requirement that states that all services should respond within X ms. We can write a test that measures the response time and fails if the result is greater than that value.

    Each new service should pass these test criteria. This way, we constantly get feedback if the development goes according to the plan.

    We should aim to identify the fitness functions from the software development's early stages. What are the most important criteria for your product? Usually, stakeholders and business analysts provide the specification. Depending on the industry, the requirements vary. For example, it’s crucial to have a stable performance and security in banking.

    Architecture standards evolve constantly. The fitness functions help break a complex system into smaller pieces. This way, it’s safer to make any changes to the software and identify any issues in an early stage.

    After collecting the necessary criteria from the key people, integrate them into a testing framework. Consider incorporating the tests in the CI/CD pipeline process.

    You’re probably familiar with Unit tests that ensure the code quality is met. Let’s cover other non-functional requirements, such as scalability, performance, and other architectural aspects.

    Architecture constraints tests

    Let’s write a test to validate architecture constraints.

    Consider a fitness function defined at the technical architecture level to control the dependencies between components. For example, for Java, there is a tool called ArchUnit. It analyzes the dependencies between packages and classes, layers and slices, checks for cyclic dependencies, and more.

    The tests can be run as JUnit tests. They prevent developers from violating architectural design principles. If someone accidentally submits a non-compliant code, the build will fail, and the developer will find out the issue on time.

    For instance, let’s verify that the controller class should call secured methods only:

    Controller test with ArchUnit, extract from https://github.com/TNG/ArchUnit/blob/main/archunit-example/example-junit5/src/test/java/com/tngtech/archunit/exampletest/junit5/ControllerRulesTest.java

    Architecture design tests

    If you’re applying the Layered Software Architecture, you can add ArchUnit tests to ensure the design is not broken:

    Layered architecture test, extracted from https://github.com/TNG/ArchUnit/blob/main/archunit-example/example-junit5/src/test/java/com/tngtech/archunit/exampletest/junit5/LayeredArchitectureTest.java

    This test ensures that only allowed layers can access the specified layers.

    Architecture and operation tests

    You can also measure a combination of architectural and operational qualities. For cloud environments, there is a tool called Chaos Monkey. The Netflix engineers invented it to test the resiliency of AWS.

    It randomly creates chaos — latency goes up, processes get terminated, and so on. The exposure of the failure ensures that developers make the services resilient to instance failures. If you want to know more about chaos tools, check out my related article about Chaos Mesh:

    Security tests

    For security, you can use Static Application Security Testing (SAST) or image scanning tools. You can prevent the usage of a container image with known vulnerabilities. For example, tools like JFrog Xray scan all of the layers in your container recursively.

    Having fitness functions ensures the software meets the desired architecture standards. By breaking down the software into smaller units, it’s easier to implement new changes. Fitness functions constantly provide feedback about the development process.

    I hope that you’ve learned something new today. Thanks for reading, and happy coding!

    The Ultimate Managed Hosting Platform
    architecture evolving fitness+ for functions programming
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Swave Digest
    • Website
    • Twitter
    • Pinterest

    WP Rocket - WordPress Caching Plugin

    Related Posts

    Anne Heche under investigation for DUI, hit and run following fiery crash, say police

    August 8, 2022

    5 Ways of Sorting Full-Text Search Results in MongoDB | by Sifeddine Lamraoui | Aug, 2022

    August 8, 2022

    Villa Trompenberg / Engel Architects

    August 8, 2022

    Mike Tyson Calls Hulu A “Slave Master” Over Stealing His Story For ‘MIKE’

    August 8, 2022
    Add A Comment

    Leave A Reply Cancel Reply

    Twitter Instagram Pinterest
    • Home
    • Privacy Policy
    • Terms & Conditions
    • Contact Us
    © 2022 Swave Digest. All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.

    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
    In case of sale of your personal information, you may opt out by using the link Do not sell my personal information.
    Cookie settingsACCEPT
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    CookieDurationDescription
    cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
    cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
    cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
    cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
    cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
    viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    Save & Accept