Skip to content

Software Development News: .NET, Java, PHP, Ruby, Agile, Databases, SOA, JavaScript, Open Source

Methods & Tools

Subscribe to Methods & Tools
if you are not afraid to read more than one page to be a smarter software developer, software tester or project manager!


Condition Coverage Explained in IL

Condition Coverage Explained in IL

condition_coverage_ilNCover calculates code coverage by breaking methods down into blocks of code which are contiguous groups of instructions (e.g. there are no control-flow statements that divert program control into or out of those blocks). These contiguous blocks are called ‚Äúbranch segments.‚ÄĚ

Branch segment blocks are connected together by control flow statements that direct program execution to the next block of code. Branches can have multiple ‚Äúout-edges‚ÄĚ as well as multiple ‚Äúin-edges‚ÄĚ. NCover tracks the unique combination of out and in edges for blocks. These are called ‚Äúcondition edges.‚ÄĚ

Branch coverage is calculated as the percentage of branch segment blocks that are executed in a method. Condition coverage is calculated as the percentage of condition edges that are executed in a method.

Through the rest of this post, we’ll describe an example of how code gets broken down into these parts during the coverage analysis process in order to calculate code coverage metrics.

In the method below NCover defines 9 branches and 12 conditions:

      public string GetBackgroundColor(string foreground_color) {
            string background_color = "black";
            switch (foreground_color) {
                case "Red":
                    background_color = "Yellow";
                case "White":
                    background_color = "Green";
                case "Blue":
                    background_color = "Gray";
            return background_color;
Natural Language Interpretation

Looking at this from a natural language perspective we see a switch statement with 3 expected case values. If we are astute in our interpretation of C# we would also assume there is an unseen case here for the default or unexpected cases. But generally speaking we’d anticipate this code to certainly have no more than 4 conditions: Red, White, Blue or something unexpected.

CLR Interpretation

This is a prime example of code that looks quite dissimilar when translated to IL. The underlying IL of .Net does have a switch statement, but in the case where a string is the object of the switch the underlying IL is converted to an IF structure and is not an optimized switch statement.

Here is the IL for that method:

   .method public hidebysig instance string GetBackgroundColor (
           string foreground_color
       ) cil managed
       .locals init (
           [0] string background_color,
           [1] string CS$1$0000,
           [2] string CS$4$0001
// branch 1  -- initialize return var and skip out of switch if string is empty
       IL_0000: nop
       IL_0001: ldstr "black"
       IL_0006: stloc.0
       IL_0007: ldarg.1
       IL_0008: stloc.2
       IL_0009: ldloc.2
       IL_000a: brfalse.s IL_004d // jump over checks if there is no value supplied
// branch 2 -- check to see if the supplied string is Red
       IL_000c: ldloc.2
       IL_000d: ldstr "Red"
       IL_0012: call bool [mscorlib]System.String::op_Equality(string,  string)
       IL_0017: brtrue.s IL_0035
// branch 3 -- check to see if the supplied string is White
       IL_0019: ldloc.2
       IL_001a: ldstr "White"
       IL_001f: call bool [mscorlib]System.String::op_Equality(string,  string)
       IL_0024: brtrue.s IL_003d
 // branch 4 -- check to see if the supplied string is Blue
       IL_0026: ldloc.2
       IL_0027: ldstr "Blue"
       IL_002c: call bool [mscorlib]System.String::op_Equality(string,  string)
       IL_0031: brtrue.s IL_0045
 // branch 5 -- all other values skip to return
       IL_0033: br.s IL_004d
 // branch 6 -- set the return to Yellow
       IL_0035: ldstr "Yellow"
       IL_003a: stloc.0
       IL_003b: br.s IL_004d 
// branch 7 -- set the return to Green
       IL_003d: ldstr "Green"
       IL_0042: stloc.0
       IL_0043: br.s IL_004d 
// branch 8 -- set the return to Gray
       IL_0045: ldstr "Gray"
       IL_004a: stloc.0
       IL_004b: br.s IL_004d
// branch 9 -- set the return to original init value of Black
       IL_004d: ldloc.0
       IL_004e: stloc.1
       IL_004f: br.s IL_0051  // always goes to next instruction no branch taken
       IL_0051: ldloc.1
       IL_0052: ret

NCover defines a branch in the IL as a set of instructions that must be executed in sequence with no chance of leaving the instruction set outside of an exception. So when breaking down a method‚Äôs IL it is fairly safe to assume that a branch will end with a ‚Äúbr‚ÄĚ instruction or an ‚Äúret‚ÄĚ. The pattern of the IL above is to check the string value against each string constant and then branch forward to another location that sets our return value. In this case the conditional comparison is a branch separate from the assignment.

Conditional Branching (2 out-edges)

Looking at the following branch from the IL let’s understand the conditional branch.

// branch 2 -- check to see if the supplied string is Red
       IL_000c: ldloc.2
       IL_000d: ldstr "Red"
       IL_0012: call bool [mscorlib]System.String::op_Equality(string,  string)
       IL_0017: brtrue.s IL_0035

At IL_0017 the branch statement will either fall through to IL_0019 or it will branch forward to IL_0035. ¬†These two possibilities are the out-edges of ‚Äúbranch 2‚ÄĚ.

Unconditional Branching (1-out-edge)

Looking at the following branch of code from the IL we can see an unconditional branch.

// branch 5 -- all other values skip to return
       IL_0033: br.s IL_004d

And unconditional branch at IL_0033 will alway branch forward to IL_004d when this instruction executes. There is no other possible out-edge from this location.

Conditions and Landing Pads

Landing pads for coverage in IL occur at the beginning of each branch. Each ‚Äúbr‚ÄĚ out-edge has a target landing pad in NCover Condition Coverage. ¬†Each time a conditional ‚Äúbr‚ÄĚ is encountered that poses the possibility for 2 out-edges; an unconditional ‚Äúbr‚ÄĚ just one. Out-edges that go to the same destination are simplified out of the branch logic as shown at IL_004f above.

In the code above we have 4 conditional branches at the following locations:

// branch 1
       IL_000a: brfalse.s IL_004d
// branch 2
       IL_0017: brtrue.s IL_0035
// branch 3
       IL_0024: brtrue.s IL_003d
// branch 4
       IL_0031: brtrue.s IL_0045

There are 4 unconditional branches at these locations:

// branch 5
       IL_0033: br.s IL_004d
// branch 6
       IL_003b: br.s IL_004d
// branch 7
       IL_0043: br.s IL_004d
// branch 8
       IL_004b: br.s IL_004d

The 8 conditional branches yield a total of 8 out-edges. The 4 unconditional branches add an additional 4 out-edges. It’s worthy to note that there are 5 distinct conditions than can all get the code to IL_004d. In order to satisfy 100% condition coverage at offset IL_004d all of those out-edges must be followed during execution. In turn all 12 out-edges must be followed to achieve 100% condition coverage for the method.

It’s also important to point out that a method with no conditional branches or switch statements will have 0 conditions but will still contain one branch, or set of instructions that must be executed in order.

Visualizing the Code

Let’s boil this down to a picture for simpler description.  The following model shows the execution logic of the IL in a flow diagram. Each box of this diagram represents a branch of code. Each arrow in the diagram represents a condition. Notice that there are 9 boxes and 12 arrows corresponding to the 9 branches and 12 conditions that NCover is reporting for this method.

visualizing-branches-and-conditions Addendum — IL Switch

While our example code in C# uses a switch statement it is not compiled to a native switch in the IL. The true switch statement in IL has no practical limit to the out-edges. One switch statement can produce a large number of out-edges rather than just the boolean option we see from conditional branch as described above.

Release Build

When you start looking at IL you will quickly see that Release and Debug build are usually different. The following IL is for the same method from above but built in Release mode:

   .method public hidebysig instance string GetBackgroundColor (
           string foreground_color
       ) cil managed
       .locals init (
           [0] string background_color,
           [1] string CS$0$0000
// branch 1
       IL_0000: ldstr "black"
       IL_0005: stloc.0
       IL_0006: ldarg.1
       IL_0007: dup
       IL_0008: stloc.1
       IL_0009: brfalse.s IL_004a
// branch 2
       IL_000b: ldloc.1
       IL_000c: ldstr "Red"
       IL_0011: call bool [mscorlib]System.String::op_Equality(string,  string)
       IL_0016: brtrue.s IL_0034
// branch 3
       IL_0018: ldloc.1
       IL_0019: ldstr "White"
       IL_001e: call bool [mscorlib]System.String::op_Equality(string,  string)
       IL_0023: brtrue.s IL_003c
// branch 4
       IL_0025: ldloc.1
       IL_0026: ldstr "Blue"
       IL_002b: call bool [mscorlib]System.String::op_Equality(string,  string)
       IL_0030: brtrue.s IL_0044
// branch 5
       IL_0032: br.s IL_004a
// branch 6
       IL_0034: ldstr "Yellow"
       IL_0039: stloc.0
       IL_003a: br.s IL_004a 
// branch 7
       IL_003c: ldstr "Green"
       IL_0041: stloc.0
       IL_0042: br.s IL_004a
// branch 8
       IL_0044: ldstr "Gray"
       IL_0049: stloc.0
       IL_004a: ldloc.0
       IL_004b: ret

The IL still has 4 conditional branches but it has optimized away one of the unconditional branches.  The release build yields 8 branches and 11 conditions in NCover coverage statistics.

The post Condition Coverage Explained in IL appeared first on NCover.

Categories: Vendor

EnterpriseDB Expands Postgres Plus to Support Developer Agility and DBA Control

Software Development Tools Directory - Thu, 02/12/2015 - 17:43
EnterpriseDB (EDB) has announced a new release of its flagship product, Postgres Plus Advanced Server. Postgres Plus Advanced Server 9.4 gives database administrators greater control and expanded options for customization that boost performance ...
Categories: Vendor

MemSQL Introduces Seamless Spark Connectivity for Enterprise Deployments

Software Development Tools Directory - Thu, 02/12/2015 - 17:41
MemSQL has announced performance connectivity to Apache Spark with its MemSQL Spark Connector, allowing enterprises to operationalize and streamline Spark deployments. The powerful combination of an in-memory database from MemSQL and Spark's ...
Categories: Vendor

Joyent Establishes Node.js Foundation

Software Development Tools Directory - Thu, 02/12/2015 - 17:40
Joyent, Inc., the corporate steward of the Node.js open source project, has announced that it will move to establish a formal open governance model for Node.js with the creation of an independent foundation. Joyent will join forces with IBM, PayP ...
Categories: Vendor

MarkLogic Releases MarkLogic 8 NoSQL Database

Software Development Tools Directory - Thu, 02/12/2015 - 17:21
MarkLogic Corporation, a Enterprise NoSQL database platform provider, has announced the general availability of MarkLogic software Version 8, the new-generation database that helps organizations achieve faster time to results, operationalize hete ...
Categories: Vendor

New Release of SmartBear Collaborator Increases Integration with Third Party Tools

Software Development Tools Directory - Thu, 02/12/2015 - 17:19
SmartBear Softwarehas made two major enhancements to Collaborator, the only tool available that allows peer review of code, user stories, test plans, Excel files and other documentation. The new JSON API functionality allows integrations with oth ...
Categories: Vendor

Sencha Space 1.3 Released

Software Development Tools Directory - Thu, 02/12/2015 - 17:10
Sencha, a provider of HTML5 desktop and mobile web application development technology, today announced the release of Sencha Space 1.3, an upgrade to its breakthrough platform for securely deploying, managing and analyzing business applications. ...
Categories: Vendor

Spira v4.2.0.5 Now Available

Inflectra News - Thu, 02/12/2015 - 01:00
We are pleased to announce the latest updates to our SpiraTeam, SpiraTest and SpiraPlan applications. These updates are available for our on-premise customers and will be applied to our hosted customers automatically.
Categories: Vendor

Inflectra Positioned as a Challenger in the Gartner 2015 Magic Quadrant for Application Development Life Cycle Management Report

Inflectra News - Thu, 02/12/2015 - 01:00
(Inflectra Corporation, Silver Spring, MD) a provider of powerful Application Development Lifecycle Management Solutions is pleased to announce that it has been named as a Challenger for Application Development Life Cycle Management based on its ability to execute and completeness of vision in the 2015 Gartner Magic Quadrant for Application Development Life Cycle Management (ADLM) by Nathan Wilson, Jim Duggan, Thomas E. Murphy, Maritess Sobejana, Joachim Herschmann, published on 9th February, 2015.
Categories: Vendor


Black Duck Software Press Releases - Wed, 02/11/2015 - 20:52

QUESTION: What does an open source vunerability and a Lego piece have in common?
ANSWER: You don't want to step on one in the dark.


Step 1Realize your company uses open source.

Gartner estimates by 2016, open source will be included in mission-critical software packages in 95 percent of global enterprises.

Step 1Implement a proper OSS governance & compliance process
to help securely manage your
open source code.

Fewer than 50 percent of organizations will have implemented an effective strategy for procuring and managing OSS, according to Gartner.

Step 1 When you realize
you need help
with step 2,
contact Black Duck.

Step 1 Feel confident in the security of your open source components and software applications.

Automated management of OSS can help your organization
avoid unnecessary risks.





Our comprehensive OSS Logistics solutions
enable enterprises of every size to gain systematic visibility into and
control over how they

Acquire Acquire
approve Acquire
Scan scan
monitor & secure Secure
Inventory inventory
& deliver Deliver

open source code.


Now, start building your Black Duck and open source security solution!

I would like * Lego Duck Instructions Open Source Governance and Compliance Guide Open Source Vulnerabilities Whitepaper Email * Get Started
Categories: Vendor


Software Development Tools Directory - Wed, 02/11/2015 - 16:19
XCMailr has been built to aid testing. Testing needs email addresses to create accounts, test formats of emails addresses, and last but not least load testing needs a ton of that. A special challenge for load testing is, that the mails should be ...
Categories: Vendor


Software Development Tools Directory - Wed, 02/11/2015 - 16:16
Agileista is an online collaboration tool for distributed Scrum teams that is available both as an open source solution and a commercial hosted service.
Categories: Vendor

Visit Ranorex at the imbus "Trends in Testing" Roadshow in Germany and Switzerland Latest News - Wed, 02/11/2015 - 11:13
Test automation is still a much discussed, multi-faceted topic ‚Äď a factor that determines success, not only in agile projects. Again and again, attempts at automation fail due to poor approach selection which results in excessive maintenance work. Sustainability, reproducibility, delivery and traceability are the quality characteristics of successful test automation. In "Trends in Testing", a German-language series of events organized by imbus AG, test automation enthusiasts, test managers/designers, software developers as well as product managers learn from test automation experts through ambitious presentations and inspiring discussions. Following the motto "Test automation to enjoy" the event features tools, methodologies and best practices and makes amusing comparisons with the field of cooking. What exactly does "four-star automation" look like?

Ranorex is attending this year's roadshow in Germany and Switzerland. Take the advantage of this opportunity and meet the experts in test automation. The imbus roadshow will take place on the following dates:
  • 11.03.2015: Stuttgart
  • 12.03.2015: Munich
  • 18.03.2015: Hofheim / Taunus
  • 19.03.2015: Cologne
  • 23.03.2015: Zurich
  • 25.03.2015: Nuremberg
  • 27.03.2015: Hamburg

The event is free and begins at 9:00 a.m. You'll find further German-language information including the agenda and an application form here: We look forward to seeing you there!
Categories: Vendor

Accelerate Automotive Innovation to Top Speed (Part 5 of 6)

Polarion Software - Wed, 02/11/2015 - 10:38
Fifth installment of a special 6-part series discussing ALM business best practices and strategies for product development in the automotive and related industries.
Categories: Vendor

Get your Free RS3 Compliance Matrix

VisibleThread - Tue, 02/10/2015 - 19:18

Army RS3 - Download your free compliance matrix here

Last week on 4th February, the Army issued the 3rd RFP draft for the $37b RS3 contract. Pretty much every major contractor is working this IDIQ (indefinite delivery/indefinite quantity).

Whether you’re a prime or sub, you’re likely maxed as the deadline for submission is only a couple of weeks away on Feb 28th.

We wanted to save you some time. So we took the latest RS3 draft RFP (DRAFT_W15P7T15R0008-0000) version 3, and ran a shred/burst using VisibleThread. And we’re sharing the generated compliance matrix with the community for FREE.

Feel free to use this matrix in whatever way you like. We won’t ask you to fill in any form, just download the generated spreadsheet directly from the link below.

If you’re pursuing this, good luck and we hope the matrix helps save you time.

Download Matrix

Click here to download the Starter Compliance matrix (XLS). We shredded the RFP with the VisibleThread full product.

Here’s a video showing you how you can generate a starter compliance matrix in under 3 minutes for any doc, PDF or MS Word.

Click here to view the embedded video.

The post Get your Free RS3 Compliance Matrix appeared first on VisibleThread.

Categories: Vendor

Rainforest Raises $4M Seed Round to Scale Enterprise QA

Software Development Tools Directory - Tue, 02/10/2015 - 18:28
Quality Assurance-as-a-service company Rainforest has raised $4 million in seed funding from Storm Ventures, Rincon, Andreessen Horowitz, Morado, and Crosslink. "The Rainforest team has managed to do something no one else has really nailed yet -- ...
Categories: Vendor

NodeSource Raises $3M for Node.js

Software Development Tools Directory - Tue, 02/10/2015 - 18:03
NodeSource, an enterprise-focused software company created to build a robust product ecosystem around Node.js, has announced $3M in first round seed funding from Crosslink Capital and Resolute Ventures. This funding exemplifies the pent-up demand ...
Categories: Vendor

Oracle Communications Network Service Orchestration Solution Helps Communications Service Providers Accelerate and Optimize Service Deployments in Virtualized Network Environments

Oracle Database News - Tue, 02/10/2015 - 14:00
Oracle Communications Network Service Orchestration Solution Helps Communications Service Providers Accelerate and Optimize Service Deployments in Virtualized Network EnvironmentsNew solution supports service providers in their evolution toward network function virtualization with flexible hybrid network management and elastic scalabilityREDWOOD SHORES, Calif. ‚Äď Feb. 10, 2015

Oracle today introduced the new Oracle Communications Network Service Orchestration Solution, which is designed to enable communications service providers (CSPs) to more quickly create new network services to respond to market demand. The solution can also help CSPs reduce service development and management costs as they introduce virtualized network capabilities‚ÄĒthe beginning of a transformation to network function virtualization (NFV) that will simplify their networks and minimize dependence on expensive, inflexible proprietary hardware.

The solution is part of the Oracle Communications intelligent orchestration framework, a holistic approach that guides CSPs as they adopt NFV technology and helps them to maximize its benefits. Specifically, the framework gathers and analyzes network performance information, evaluates the network’s operation against predefined policies and business rules, and can trigger the appropriate action to automatically modify the behavior of services, network functions, and virtualized infrastructure.

‚ÄúWhile network virtualization promises to streamline operations in the long run, the short-term effect actually may be an increase in complexity when configuring and managing hybrid networks. This will require sophisticated orchestration of network services, network functions, and underlying infrastructure enriched by analytics and triggered by policy rules. Such a holistic approach to orchestration, like the one outlined by Oracle, is critical for CSPs to deliver the anticipated business benefits from their NFV investments,‚ÄĚ said Dimitris Mavrakis, principal analyst, Ovum.

Oracle Communications Network Service Orchestration Solution gives CSPs the ability to rapidly deploy and scale network services on demand across multiple virtual network functions (VNFs) in complex virtualized and hybrid network environments. CSPs can use this solution to:

Quickly respond to changes in service or market demand Compose and on-board new network service templates and associated business rules using a flexible, graphical design environment, and then validate that these network services are operational and manage how they are scaled Choose and control the selection of solution components in multivendor environments. The solution leverages open standards including RESTful (web service) application programming interfaces (APIs) for integration with other management and orchestration components, such as the previously released Oracle Communications Application Orchestrator or third-party VNF managers and virtualized infrastructure managers Seamlessly introduce virtual network infrastructure and then manage this infrastructure and network service fulfillment when deployed as an extension of Oracle Communications’ leading operations support systems (OSS) portfolio

‚ÄúCSPs are taking the first steps toward network virtualization‚ÄĒsomething they know they must do to compete for the long-term. This is a journey, not just a moment in time, which is why we have outlined an end-to-end intelligent orchestration framework. Our approach will provide CSPs with the business and service agility required to make progress toward full NFV. With our new Oracle Communications Network Service Orchestration solution, we are continuing to deliver on our vision for NFV,‚ÄĚ said Barry Hill, global head of NFV, Oracle Communications.

‚ÄúNFV is complex, and CSPs have made it clear that to be successful, they need comprehensive orchestration. The new Oracle Communications Network Service Orchestration solution is a direct response to this need. It allows for dynamic network operation, enabling the transformation of the business‚ÄĒnot just the network. With these developments and an expanding portfolio of virtualized network functions, endorsement of Open Stack, leading OSS solutions, and strong IT heritage, Oracle Communications is enabling service providers to fully embrace the NFV opportunity,‚ÄĚ said Liam Maxwell, vice president of products, Oracle Communications.

Oracle Communications Network Service Orchestration Solution fulfills and extends the role of the NFV Orchestrator as defined by the European Telecommunications Standards Institute (ETSI) NFV Industry Standards Group, the primary standards body guiding NFV development. Because it has a semantic understanding of each network service, the Oracle Communications solution can calculate and apply configuration changes, including updates to the network topology or service context data‚ÄĒcritical for orchestrating network services through their full lifecycle.

Oracle will showcase this solution as part of the ‚ÄúIntelligent NFV Management and Orchestration Solution‚ÄĚ demonstration in Hall 3, Stand 3B20 at Mobile World Congress in Barcelona, March 2 ‚Äď 5, 2015.

Additional Information

To learn more about Oracle Communications Network Service Orchestration Solution and other Oracle Communications solutions, please connect on Twitter @OracleComms and at

About Oracle

Oracle engineers hardware and software to work together in the cloud and in your data center. For more information about Oracle (NYSE:ORCL), visit


Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.


Kaitlin McCready

Janice Clayton

Categories: Database, Vendor

Remercions nos membres Français de la communauté .NET

No need to check your translation settings. We meant to do that. The .NET community is far reaching and offers some really great contributors striving to make us all better programs. We wanted to put a spotlight on these two French .NET developers making us better one line of code at a time.

Bruno Boucard

ncover_mvp_bruno_boucard_twitterBruno has been a specialist in Microsoft technologies for many years. He has a wide experience ranging from programming for kernel mode to managing projects using agile methodologies. Once .NET was announced back in 2000, he quickly started to learn C#.

His passion for Microsoft technologies drew him to Microsoft France where he worked as a consultant for a time, but nostalgia for the trading floor has taken him back to Société Générale where he now manages a team of software architects. Currently, he is working for BNP PARIBAS as technical architect. He remains passionate about innovation, like the parallel programming with Visual Studio 2010, 2012 and 2013 (and more). Check out his blog on parallel programming here.

Christopher Maneu

ncover_mvp_christopher_maneu_twitterChristopher is a developer and technical writer expert in Microsoft solutions. He loves spending his time creating user-friendly software on devices. You may see him working at Deezer as a UI Engineer or around the continent speaking at professional conferences.

He also is on The Developer Guidance team and sits on the Server & Tools Division with Microsoft. Their mission is to create rich and compelling guidance to ensure developer success on all Microsoft platforms during the planning, development and post-release phases of all products.

In his downtime, you will find him under the sea as a scuba instructor. You can keep up with his experiences on his blog or follow him on twitter @cmaneu


The post Remercions nos membres Français de la communauté .NET appeared first on NCover.

Categories: Vendor


Software Development Tools Directory - Mon, 02/09/2015 - 14:21
Seleno helps you to write automated UI tests in the right way by implementing Page Objects and Page Components and by reading and writing web page data using strongly typed view models. It uses Selenium Web Driver for browser automation.
Categories: Vendor