Skip to content
  • Blog
  • Events
  • Help
  • Careers
  • Contact
New Signature
  • About
      • Company

        Cognizant Microsoft Business Group is dedicated to changing the way businesses innovate, transform and run based on a unique cloud operating model. You will now be redirected to our new microsite to learn more.

        View Company

      • Awards

        As a company, we are regularly recognized within the IT industry as well as the communities we serve.

        View All Awards
      • News

        Read the most up-to-date corporate announcements, Microsoft technology updates, innovative business solutions and learn more about how the Cognizant Microsoft Business Group can take your business even farther.

        View News

      • Partners

        New Signature works with a number of outstanding technology companies to deliver the best experiences to our customers.

        View Partners
      • Leadership

        Cognizant Microsoft Business Group’s executive team is comprised of innovative leaders with proven experience and deep industry expertise. You will now be redirected to our new microsite to learn more.

        View Leadership

      • Industries

        Our solutions are tailored to empower organizations across a wide range
        of industries.

        View Industry Experience
    Close
  • Solutions
      • Intelligent Enterprise
        Solutions

        Going Digital
        Unleash cloud capability, deliver change and compete at speed with a Microsoft digital operating model, enabling you to work more efficiently as you transform your IT environment. Learn More

      • Featured Solution

        Secure Cloud
        In a world of constant threat, ensuring that your underlying cloud platform is protected is the first step on your organization’s journey towards a secure, compliant operating environment. Learn More
      • Intelligent Workplace
        Solutions

      • Secure Workplace

        Work Anywhere

        Endpoint Health

        Identity Health

        Teamwork Support



        VIEW WORKPLACE SOLUTIONS
      • Intelligent Cloud
        Solutions

      • App Factory

        Azure Accelerator

        Azure Launchpad

        Azure Launchpad for DevOps

        Application Health

        Platform Health

        VIEW ClOUD SOLUTIONS
    Close
  • Services
      • Begin your journey towards becoming a digital business with GO, our unique end-to-end framework based on the Microsoft Cloud Adoption Framework.

        GO DIGITAL OPERATING MODEL
      • Intelligent Enterprise

      • Consulting

        We go beyond just technology to help your organization understand how digital can help you uniquely differentiate and better serve your employees and customers.

        VIEW ENTERPRISE SERVICES
      • Intelligent Workplace

        • Identity

          Identity is your new first-line-of-defense. It’s vital to your users and clients that your identity platform is properly configured and secured.

          Endpoint

          Whether your devices are on-premises or remote, personal or business-owned, we can ensure they are properly managed and protected.

          Teamwork

          Today’s workforce is collaborating than ever before.  We can empower your current teams with tomorrow’s progressive technologies.

          VIEW WORKPLACE SERVICES
        • Intelligent Cloud

          • Platform

            The cloud is no longer some future-state. It’s the here and now. Adopting a cloud-first platform is one of the best ways to maintain a future-proofed competitive advantage.

            Applications

            We build cloud-native apps and modernize legacy systems with the power of Azure to give your organization a competitive edge.

            Data

            We can help your organization create secure, scalable data platforms to deliver simpler and more sophisticated insights to your business.

            VIEW CLOUD SERVICES
        Close
      • Client Stories
          • Case Studies

            Browse a comprehensive list of companies who have created successful partnerships and experienced transformative solutions with New Signature.

            View All Case Studies

          • Featured Case Study TalkTalk Modern Workplace

            New Signature worked with TalkTalk to define a new Modern Workplace solution based on Microsoft 365, which kept the user firmly at the center of the transformation.
            View Case Study

          • Testimonials

            We love transforming our customers businesses, take a look at what they have to say about New Signature.

            View Testimonials

          • Featured Testimonial Davis Construction

            With New Signature’s help, Davis was able to take a progressive step forward by migrating their private branch exchange (PBX) phone system to a Voice of Internet Protocol (VoIP) system.
            View Testimonial

        Close
      • Explore
          • Guides & Ebooks

            Dive deeper into education with your team by leveraging our expert-developed guides and eBooks.

            View All Guides & Ebooks

          • Infographics

            Rich with statistics and information, our infographics are great tools for quick but insightful learning.

            View All Infographics
          • Podcast: Office Explorers

            Join Kat and Rob monthly as they chat with New Signature experts and explore the world of O365.

            Listen to Podcasts

          • Videos

            Visit our videos stream to access recorded webinars, service information and to learn more about us.

            WATCH ALL VIDEOS
          • Flyers

            Searching for information about our services? Our flyers are a great takeaway for all those details.

            VIEW ALL FLYERS

          • Featured Stream

            Learn more about the tooling and expertise required to unlock productivity and mobilize your teams.

            MODERN WORKPLACE
        Close
        Close
      Blog

      Modernizing with Care: Unit Tests as Feedback

      New Signature / Blog / Modernizing with Care: Unit Tests as Feedback
      March 9, 2018| Cliff Chapman
      • Facebook
      • Twitter
      • LinkedIn
      • Print

      You’ve got the greenlight. Your team got the go-ahead to bring a handful of old dependencies up to date as part of your modernization efforts. They’ve all put in plenty of time working hard to make sure the public API wasn’t impacted. Several have even talked to other teams in the company to make sure they aren’t surprised. Everything is going smoothly until you get a frantic call after release that some poorly documented web service is making use of an old set of functionality that wasn’t properly tested.

      We’ve all been there before. Some part of your codebase that has escaped documentation or manual tester’s efforts comes back to bite you. What went wrong? What could have prevented this?

      Refactoring With Instant Feedback

      Often the point of a refactor is to reduce your technical debt burden. It isn’t supposed to (or is required to not) impact customer experience. Knowing that you haven’t impacted customer experience is difficult to determine without lots of manual effort for testing. If the developers are the test team this means time not spent writing code. If the test team is a separate group that means a long developer cycle to have feedback. One might find that this is likely how the technical debt became a problem in the first place. If your developer loop is long you don’t have time to spend making incremental fixes over time.

      Wouldn’t it be better, then, to have instantaneous feedback on your efforts?

      Enter unit testing, that practice your team has been putting off for years. There is no better time to start writing unit tests than right before changing larger aspects of your application. Unit tests, as the name implies, are testing units of your code. They’re meant to only be testing the public boundary of your code; the parts other applications can interface with. Writing test cases that exercise this interface can give you feedback about what effects your modifications might be having to what other outside applications are expecting.

      And the instantaneous part? Visual Studio has you covered. The Live Unit Testing feature in Visual Studio Enterprise will continuously execute these unit tests in the background, bubbling up the results to you right to the side of the lines of code they’re testing. Make a change that breaks something? Receive immediate results indicating what went wrong and what tests to investigate. Fix your typo? Get lovely green checkmarks letting you know everything is back on track.

      Image

      Several other IDEs have plugins granting similar feature sets, and .NET Core has its own system. Scott Hanselman discussed dotnet watch on his blog.

      Low Barrier to High Reward

      We often hear a discussion on unit testing starting with responses along the lines of “That’ll take too much time and the developers are already overworked”, or “We simply can’t fit unit testing into our scrum cycles now.” I’ve always found it a curious sort of statement, as even just a handful of simple unit tests exercising a shared library can prevent of back-and-forth bugfixing sessions between the QA and Dev departments.

      Creating a unit test project in Visual Studio for C# is as simple as right-clicking the method you want to test and selecting ‘Create Unit Tests‘. You’ll be presented with a few fields to fill out related to common project information. In under a minute you can go from no tests to having your framework set up and ready to accept any new tests.

      Being unit tests indicates that the tests should be short in length but great in number. Two tests per if statement is a good ballpark to start with, but even that can be optional for overworked teams. Simply writing unit tests whenever you can will start to grow their count in your system, and any unit tests in the system can help avoid simple mistakes before anything gets handed off to a different team.

      Adding new unit tests to your unit test project is as simple as adding a new method to the class, or adding a new test class to mirror your own project’s structure as it grows. Unit tests themselves often require far less intensive thought than adding new features, or working with complicated logic. This means that half-hour between two meetings is no longer unproductive time. It’s plenty  of time to bash out a series of unit tests for a handful of functions that you’ll be rewriting after the meeting.

      Rather than spending 10 minutes talking about how unit tests are hard to write, take those 10 minutes and just write up one or two tests. Having the framework ready to go reduces the already low barrier to entry on getting started writing your tests cases.

      Investment in the Future

      Once those cases are written out they become part of your codebase. Living in version control, being compiled in the same build server, and most important of all being pulled down onto every developer’s machines for them to run before trying to commit code back up. When written out these test cases can be executed many times very quickly whenever change happens. Gating check-ins on not only a successful build but also a successful run of available unit tests is a very common practice once companies start rolling out these tests. The more unit tests you have available the more areas of your code will provide feedback on changes when they occur. VSTS’s integration with running unit tests during build and release steps has only gotten better over time.

      View test run results summary

      It’s not uncommon to see unit tests live longer than the guts of the function they’re testing. Larger unit tests that lean more towards functional testing can last even longer, surviving through multiple refactorings if the public API they’re testing isn’t supposed to be changing. Therefore the time spent writing and maintaining tests is rarely wasted, and the benefits can continue to be reaped throughout the lifetime of the code they’re testing.

      Even just small amounts of time dropped into writing unit tests can go a long way to preventing simple mistakes from slipping through your testing process. With a robust fleet of test cases being run every time a developer checks in code those mistakes might not ever see the test team at all, let alone your end users. The more time saved dealing with production issues and QA department feedback means more time spent making your users happy. Consider taking an hour or two out of your next sprint to get a few unit tests down in your git repo.

      We’re Wrapping Up Our “App Modernization” Workshop Series!

      We’ve been traveling around the Southeast the last couple of months hosting Application Modernization workshops and we’ve got one workshop left on Tuesday, March 27th in Atlanta, Georgia. If you can’t attend the workshop, we are also hosting a webinar, “Journey to the Cloud – Modernize Your Applications with Azure”, on Thursday, March 15th. Click here for more information and to register!

      Categories
      News, Tips and Tricks
      Contact New Signature

      Events

      Thu 28

      Power Platform Series: Drive Organizational Productivity with Power Virtual Agents

      January 28 @ 10:00 am - 10:45 am EST
      Feb 16

      Cognizant’s Experience Lab for Continuous Testing with Azure

      February 16 @ 12:00 pm - 2:00 pm EST

      View More

      New Signature
      New Signature HQ
      901 K Street NW, Suite 450
      Washington, DC 20001
      Phone: 202-452-5923
      New Signature Canada HQ
      7th Floor, 5140 Yonge Street
      Toronto, ON M2N 7J8
      Phone: 416-971-4267
      New Signature UK HQ
      57 Bermondsey Street
      London SE1 3XJ
      Phone: +44 (0) 845-402-1752

      About

      • Company
      • Awards
      • News
      • Leadership
      • Partners
      • Industries

      Solutions

      • Intelligent Enterprise Solutions
      • Intelligent Workplace Solutions
      • Intelligent Cloud Solutions

      Services

      • GO
      • Intelligent Enterprise
      • Intelligent Workplace
      • Intelligent Cloud

      Client Stories

      • Client Stories
      • Testimonials

      Explore

      • Guides & Ebooks
      • Podcasts
      • Flyers
      • Infographics
      • Videos
      Copyright © 2021 New Signature
      • Blog
      • Events
      • Careers
      • Help
      • Anti Slavery
      • Privacy Policy
      • Contact
      • About
        • Company
        • Awards
        • News
        • Leadership
        • Partners
        • Industries
      • Services
        • GO
        • Intelligent Enterprise
        • Intelligent Workplace
        • Intelligent Cloud
      • Client Stories
        • Case Studies
        • Testimonials
      • Technologies
      • Explore
        • Guides & Ebooks
        • Infographics
        • Podcast: Office Explorers
        • Videos
        • Flyers
      • Blog
      • Events
      • Careers
      • Contact
      • Search
      Cookie Settings
      New Signature uses "Required Cookies" to run our website, "Functional Cookies" used by third parties to personalise marketing, including social media features.

      Change your preferences by clicking the “Cookie Settings” link at the bottom of every page. Learn more about cookies in our Cookie Policy and our Privacy Policy. By clicking the “Accept Cookies” button below, you consent to our use of cookies.

      Please note that “Required Cookies” will be set regardless of your consent.
      Cookie SettingsAccept Cookies
      Privacy & Cookies Policy
      Performance

      Performance Cookies provide Content Delivery Network assets that deliver faster site content delivery capabilities.

      Required

      These cookies are required mainly in order to deliver Multilanguage site capabilities.

      Functional

      Functional Cookies allow us to provided advanced media capabilities including videos, surveys and other multimedia capabilities.

      Disabling Functional cookies will block the playing of videos and other multimedia site components.

      Targeting

      Targeting Cookies are used to capture user information in order for New Signature to deliver better user experiences.

      Save & Accept