Read Feature#1 Account Management in my previous article.

Abstract

Window Layout is a new Visual Studio 2015 feature related to developer’s productivity and ease of interaction with Visual Studio 2015 IDE. In previous version of Visual Studio developers were able to arrange windows as per their need but temporarily. Visual Studio 2015 extends this experience with some productivity enhancements.

Introduction

Window Layout is directly related to the way numerous windows are arranged and laid out in a Visual Studio IDE. IDE (Integrated Development Environment) is every developer’s tool for being creative, develop new things, being logical, fix issues, build and deploy various LOB (Line of Business) solutions etc.

Why Window Layout?

Different developer personality types like the windows to be arrange in specific way. Some like certain windows in the IDE and some like other windows. Some may like Pinned windows and some Tab styled.

Hence, Window Layout enables a developer’s to arrange the windows which they want and how they want and then save the layout for later use. Saved layout can be accessed from any machine on any device and applied to the IDE as long as that layout was saved to your Account Settings via Synchronization. Read Feature#1 Account Management in my previous article

So Window Layout enables you to arrange the IDE in a way you are most comfortable with and provides ease of use and productivity.

Which Windows are those?

Well, today Visual Studio 2015 stands mature and has a lot of windows which may appear in a developer’s screen wrapped into the IDE. For instance:

  1. Solution Explorer
  2. Team Explorer
  3. Server Explorer
  4. SQL Server Object Explorer
  5. Bookmark Window
  6. Call Hierarchy
  7. Class View
  8. Code Definition Window
  9. Object Browser
  10. Error List
  11. Output
  12. Task List
  13. Toolbox
  14. Class view

This list goes on and on, so let’s see the whole list via Visual Studio 2015 View menu.

Figure-1: Visual Studio 2015 View Menu

How to Save a Window Layout

Before you start saving a Window Layout, you to create one. Follow these steps:

1- Arrange windows (all which you work with mostly) in your desired way. For example as shown below:

Figure-2: Arrange windows in Studio 2015

2- Now let’s save this Window Layout. Click on Window menu and choose “Save Window Layout”

Figure-3: Save Window Layout menus option

3- Name the Layout properly so you can recall from the name and click OK.

Figure-4: Naming a Layout

4- Now Layout is Saved and Synchronized with your Account Settings.

Reset Window Layout

Once you have saved the Layout and you want to test it, you have to reset the layout to default layout which Visual Studio IDE brings to you.

Go to Window menus and click on “Reset Window Layout”

Figure-5: Reset Window Layout menus option

Once you click on this option, Visual Studio will prompt you to confirm that you want to restore the default window layout. Click on Yes.

Figure-6: Confirmation dialog to Reset Window Layout

Now, Your IDE will be re-arranged to default layout as shown in the image below. Which could be the one you are having right now in your Visual Studio IDE.

Figure-7: Default layout after Reset of the layout

Applying Saved Window Layout

To apply your saved Window Layout, go to Window menus and click on “Apply Window Layout” and choose one of the previously saved Window Layout. I have created and named my layout as “Pinned_Windows”

Figure-8: Apply Window Layout menu option

Click on “Pinned_Windows” layout and Visual Studio will show a confirmation dialog, click OK

Figure-9: Confirmation to Apply saved Window Layout

Now your layout will change to what you have saved and IDE will appear as shown below.

Figure-10: Saved layout applied

Manage Window Layout

As you can imagine you may end up with creating and cleaning up layout as per your needs. Hence, it become very important to manage the layouts which are created and available in your Account Settings.

You can easily manage the layouts via Window menu and “Manage Window Layout” option

Figure-11: Manage Window Layouts menu option

Once you click on it, a dialog will open and allow you to Rename, Delete etc.

Figure-12: Manage Window Layouts dialog

Summary

Custom Window Layout in Visual Studio 2015 is a brand new way of arranging the windows in the IDE and saving the layout. After saving the layout, it’s also easy to manage and restore the window arrangements. This feature certainly helps the developers to feel comfortable with their window arrangements and continue to be productive across the devices using Visual Studio 2015.

Related Articles:

Inside Out: TDD using C#

Visual Studio and .NET Unit Test Framework

Unit Test Automation with Visual Studio

Introduction

Unit Tests play an important role in delivering high quality software solutions. An ideal unit test is a piece of code (automated test) written by a developer which exercises a small but specific area of code functionality to ensure that it works as expected.

Why Unit Test

According to the Test Triangle, in a software project the largest number of tests must be Unit Tests. Because multiple individual Unit Tests exercises small units of functionality which spans over entire various areas of functionality offered by the software solution.

 

Unit Test Check-List

While writing Unit Test(s) following points must be considered and followed by the Developers and SDETs.

Check

Description

  √

Self-Describing Names

Unit Test method names must be Self-Describing and Pascal case.  For example choose Add_New_Customer_With_Valid_AcccountNumber over AddCustomer_with_validAcc or addCustomer etc.Also focus on naming style, keep the naming style consistent across all the tests methods and test.

   [ ]

A3 (Arrange, Asset, Act)

Make sure that all the Test Methods are designed around Arrange, Act and Assert.If required Refactor your code to fall into these three sections.

   [ ]

Test Happy and Sad Path

The unit test should cover all possible scenarios and strive for high code coverage and ensuring good quality metrics. Unit Test methods must exercise all possible use case scenarios to test the input validations, interactions, errors messages, edge cases and exceptions etc.

   [ ]

Make use of Attributes

Use Test Framework provided Attributes like :

[TestCategory(“<describe if its Unit or Integration Test>”)]

[TestCategory(“<Which section of the application is being tested>”)]

[Priority(n), TestCategory(“<define if it’s Gated or not-Gated build Tests>”)]

[WorkItem(xxxx)]

[Owner(“<who wrote this test>”)]

   [ ]

Have least number of asserts per test (if applicable)

A good Unit test should only have limited # of assert statements. It should unit test the very functionality, as indicated in its descriptive name.A well-defined Unit Test should contain only one assert statement per test and must not try to exercise all the validation/boundary checks etc. by multiple Assert() in one Unit Test method. .

   [ ]

Keep assert messages descriptive

Use descriptive messages to improve readability of code and the build log.Assert.IsTrue(customer.IsExist,”The Customer is not found in the Database”);

   [ ]

Unit != Integration

There is a very fine line between Unit and Integration, if you happen to go beyond what your function is supposed to be doing then you are not writing a Unit Test. I.e. Unit Test doesn’t focus on interaction with external systems and software layers/dependencies.Test Doubles (for example Microsoft Fakes framework) comes into the picture to write unit tests which has dependencies on external libraries and systems etc.

   [ ]

Follow OOP Design and Adopt DI

Following Dependency Injection will allow to convert potential Integration Tests into small and quickly testable Unit Tests by taking advantages of Test Doubles (e.g. Microsoft Fakes, Moq, FakeItEasy frameworks etc.)

   [ ]

Should be thorough

Unit Tests are supposed to test all the possible areas of functionality that are subject to failure due to incorrect input/validation checks/boundary checks etc. for given function/method.

   [ ]

Must be Repeatable

Unit Tests must be repeatable for every build and must produce the same results. The development best practice suggests that if you are working on code that is impacting a Unit Test then you must fix the affected Unit Test as well and ensure that it passes.

   [ ]

Have to be Independent

Unit Tests must be independent of another test. In other words, no collateral damage. Hence, a Unit Test must focus only on a small aspect of big functionality. When this Unit Test fails, it should be easy to discover where the issue is in the code. I.e. can be tested in isolation

   [ ]

Keep it Professional

Even though at times Unit Tests may appear to be very simple and small, you must write Unit Tests with coding practices as good as you use for your main development coding. You may want to follow Refactoring, Code Analysis and Code Review practices and so on as for your Test Projects as well.

  [ ]

No Collateral Damage

Make Sure to Run all related Unit Tests after any dev code change big or small; to verify and ensure that no collateral damage occurs or has been introduced.

  [ ]

If you break it, You bought it

If you are working on a feature and to verify no collateral damage, as a best practice run all the Unit Tests. If you observe that some Unit Tests started failing because of your code changes then you own to Fix those broken Unit Tests to make sure that continue to pass.

  [ ]

Track and  maintain the tests

The test code changes should be tracked and maintained as on-going effort. Continue to follow thedesign principles and coding guidelines.

  [ ]

Code Review the Tests

Just like any other Dev code, Unit Tests also needs to be code reviewed by peer. Regardless of size of the test; follow the process.Code review might include reviewing the name of test method, scenarios covered, conditions checked, scope of assertions and code / design smells etc.