title
stringlengths
3
46
content
stringlengths
0
1.6k
3:21
It is important to mention that public projects can be used so long as you comply with the Azure DevOps code of conduct. Once you define the name of the project and its visibility, you will have the project created in seconds.
3:22
3:23
Figure 3.3: Azure DevOps project created
3:24
DevOps itself will be discussed in detail in Chapter 8, Understanding DevOps Principles and CI/CD, but you need to understand it as a philosophy that is focused on delivering value to customers. It is the union of people, processes, and products, where the Continuous Integration and Continuous Deployment (CI/CD) methodology is used to apply continuous improvements to a software application delivered to the production environment. Azure DevOps is a powerful tool whose range of applications encompasses all the steps involved in both the initial development of an application and its subsequent CI/CD process.
3:25
Azure DevOps contains tools for collecting requirements and organizing the whole development process. They can be accessed by clicking the Boards menu option on the Azure DevOps page.
3:26
3:27
Figure 3.4: Azure DevOps Boards menu
3:28
All other functionalities available in Azure DevOps are briefly reviewed in the following subsections. They will be discussed in detail in other chapters. More specifically, DevOps principles and CI/CD are discussed in Chapter 8, Understanding DevOps Principles and CI/CD, and build/test pipelines can be reviewed in Chapter 9, Testing Your Enterprise Application.
3:29
Managing system requirements in Azure DevOps
3:30
Azure DevOps enables you to document system requirements using work items. Work items are stored in your project as chunks of information that can be assigned to a person. They are classified into various types and may contain a measure of the development effort required, a status, and the development stage (iteration) they belong to. Mainly, they are tasks or actions that need to be completed to deliver a product or service.
3:31
DevOps is usually combined with agile methodologies, so Azure DevOps uses iterations, and the whole development process is organized as a set of sprints. The work items available depend on the work item process you select while creating the Azure DevOps project.
3:32
3:33
You can check project types in Azure DevOps at https://learn.microsoft.com/en-us/azure/devops/boards/work-items/guidance/choose-process.
3:34
3:35
The following subsections contain a description of the most common work item types that appear when an Agile or Scrum work item process is selected (the default is Agile).
3:36
Epic work items
3:37
Imagine you are developing a system comprising various subsystems. You are probably not going to conclude the whole system in a single iteration. Therefore, we need an umbrella spanning several iterations to encapsulate all features of each subsystem. Each Epic work item represents one of these umbrellas that can contain several features to be implemented in various development iterations.
3:38
In the Epic work item, you can define the state and acceptance criteria as well as the start date and target date. Besides this, you can also provide a priority and an effort estimate. All this detailed information helps the stakeholders to follow the development process. This is useful as a macro view of the project.
3:39
Feature work items
3:40
All the information that you provide in an Epic work item can also be placed in a Feature work item. So, the difference between these two types of work items is not related to the kind of information they contain but rather to their respective roles and the goals your team aims to accomplish by completing. A feature is a shippable software component. Epics may span several iterations and are hierarchically above Features; that is, each Epic work item is linked to several children features, while each Feature work item is usually implemented in a few sprints and is part of a single Epic work item.
3:41
It is worth mentioning that all work items have sections for team discussions. There, you will be able to find a team member in the discussion area by typing the @ character (as in many forums/social media applications). Inside each work item, you can link and attach various information. You may also check the history of the current work item in a specific section.
3:42
Feature work items are the places to start recording user requirements. For instance, you can write a Feature work item called Access Control to define the complete functionality needed to implement the system access control.
3:43
Product Backlog items/User Story work items
3:44
Which of these work items is available depends on the working item process selected. There are minor differences between them, but their purpose is essentially the same. They contain detailed requirements for the features, described by the Feature work items they are connected to. More specifically, each Product Backlog/User Story work item specifies the requirements of a single functionality that is part of the behavior described in its parent Feature work item.
3:45
For instance, in a Feature work item for system access control, the maintenance of the users and the login interface should be two different User Story/Product Backlog items. These requirements will guide the creation of other child work items:
3:46
3:47
Tasks: These are important work items that describe the job that needs to be done to meet the requirements stated in the father Product Backlog items/User Story work item. Task work items can contain time estimates, which help with team capacity management and overall scheduling.
3:48
Test cases: These items describe how to test the functionality described by the requirements.
3:49
3:50
3:51
Considering that you will have many work items in a project, visualizing them is not an easy task. For this reason, you may consider Work Item Visualization to simplify your view. Check it out at https://marketplace.visualstudio.com/items?itemName=ms-devlabs.WorkItemVisualization.
3:52
3:53
The number of tasks and test cases you will create for each Product Backlog/User Story work item will vary according to the development and testing scenario you use.
3:54
Azure DevOps repository
3:55
There is no software without code, and the code that will be implemented according to a software requirement needs to be placed in a software repository. The Repos menu item gives you access to a default Git repository where you can place your project’s code:
3:56
3:57
Figure 3.5: Azure DevOps Repos menu
3:58
By clicking the Files item, you enter the default repository initial page. It is empty and contains instructions on how to connect to this default repository.
3:59
You can add further repositories through the drop-down menu at the top of the page:
3:60
3:61
Figure 3.6: Adding a new repository
3:62
All repositories created are accessible through the same drop-down menu.
3:63
As shown in the preceding screenshot, each repository’s initial page contains the repository address and a button to generate repository-specific credentials, so you can connect to your DevOps repositories with your favorite Git tools. However, you can also connect from inside Visual Studio in a very simple way:
3:64
3:65
Start Visual Studio and ensure you are logged in to it with the same Microsoft account used to define your DevOps project (or that was used to add you as a team member).
3:66
If the Git Changes window is not open, make it appear by going to the top menu in Visual Studio and selecting View -> Git Changes.
3:67
3:68
3:69
Figure 3.7: Git Changes window
3:70
3:71
Click the Create Git Repository... button in the Git Changes window.
3:72
In the window that opens, select Existing remote and insert the URL of the DevOps repository you created. Then, click Create and Push:
3:73
3:74
3:75
Figure 3.8: Connecting to the remote DevOps repository
3:76
Once connected to your DevOps remote repository, the Git Changes window will show several Git commands:
3:77
3:78
Figure 3.9: Git Changes window
3:79
When you have changes to commit, you can insert a message in the textbox at the top of the window and commit them locally by clicking the Commit All button, or you can click the dropdown next to this button to access more options:
3:80
3:81
Figure 3.10: Commit options
3:82
You can commit and push or commit and sync, but you can also stage your changes. The three arrows in the top right of the Git Changes window trigger a fetch, pull, and push, respectively. Meanwhile, the dropdown at the top of the window takes care of operations on branches:
3:83
3:84
Figure 3.11: Branch operations
3:85
Package feeds
3:86
A great way to accelerate software development is by reusing code components that meet the user requirements. These components, in general, are placed into packages. We will discuss this further in Chapter 5, Implementing Code Reusability in C# 12. The Artifacts menu handles the software packages used or created by the project. There, you can define feeds for basically all types of packages, including NuGet, Node.js, and Python. Private feeds are required since commercial projects also use private packages, so you need a place to put them. Moreover, packages produced during builds are placed in these feeds, so other modules that have them as dependencies can immediately use them.
3:87
Once in the Artifacts area, you can create several feeds by clicking the + Create Feed button, where each feed can handle several kinds of packages, as shown in Figure 3.12.
3:88
3:89
Figure 3.12: Feed creation
3:90
If you select the option to connect to packages from public sources, by default, the feed connects to npmjs, nuget.org, pypi.org, and Maven. However, you can go to the Search Upstream sources tab on the Feed settings page and remove/add package sources. The settings page can be reached by clicking the settings icon in the upper-right corner of the feed page.
3:91
A screenshot of the page of the newly created feed follows:
3:92
3:93
Figure 3.13: Feed page
3:94
The Connect to Feed button for each feed shows a window that explains how to connect to the feed for each package type.
3:95
3:96
Figure 3.14: Feed connection information
3:97
For NuGet packages, you should add all project feeds to your Visual Studio projects’/solutions’ nuget.config file so that local machines can also use them; otherwise, your local build will fail.
3:98
Test Plans
3:99
The Test Plans section allows you to define the test plans you want to use and their settings. Tests are discussed in detail in Chapter 9, Testing Your Enterprise Application, but here, we would like to summarize the opportunities offered by Azure DevOps. Test-related operations and settings can be accessed through the Test Plans menu item.
3:100
3:101
Figure 3.15: Test Plans menu
3:102
Here, you may define, execute, and track test plans made up of the following:
3:103
3:104
Manual acceptance tests
3:105
Automatic unit tests
3:106
Load tests
3:107
3:108
Automatic unit tests must be defined in test projects contained in the Visual Studio solution and based on a framework such as NUnit, xUnit, and MSTest (the .NET SDK has project templates for all of them, so you may find them in Visual Studio). Test Plans gives you the opportunity to execute these tests on Azure and to define the following:
3:109
3:110
Several configuration settings
3:111
When to execute them
3:112
How to track them and where to report their results in the overall project documentation
3:113
3:114
For manual tests, you may define complete instructions for the operator in the project documentation, covering the environment in which to execute them (for example, an operating system) and where to report their results. You can also define how to execute load tests and how to measure the results.
3:115
Pipelines
3:116
Pipelines are automatic action plans that specify all steps from the code build until the software deployment is in production. They can be defined in the Pipelines area, which is accessible through the Pipelines menu item:
3:117
3:118
Figure 3.16: Pipelines menu
3:119
There, you can define a complete pipeline of tasks to be executed alongside their triggering events, which encompass steps such as code building, launching test plans, and what to do after the tests have passed.
3:120
Typically, after the tests have passed, the application is automatically deployed in a staging area where it can be beta-tested. You can also define the criteria for automatic deployment to production. Such criteria include, but are not limited to, the following: