Skip to main content

Cyclomatic complexity

Cyclomatic complexity is a software metric (measurement). It was developed by Thomas McCabe and is used to measure the complexity of a program. It directly measures the number of linearly independent paths through a program's source code. It is computed using a graph that describes the control flow of the program. The nodes of the graph correspond to the commands of a program. A directed edge connects two nodes if the second command might be executed immediately after the first command.


M = E − N + 2P


M = cyclomatic complexity
E = the number of edges of the graph
N = the number of nodes of the graph
P = the number of connected components.

"M" is alternatively defined to be one larger than the number of decision points (if/case-statements, while-statements, etc) in a module (function, procedure, chart node, etc.), or more generally a system.

Separate subroutines are treated as being independent, disconnected components of the program's control flow graph.

Alternative definition

v(G) = e − n + p
G is a program's flowgraph
e is the number of edges (arcs) in the flowgraph
n is the number of nodes in the flowgraph
p is the number of connected components

Alternative way

There is another simple way to determine the cyclomatic number. This is done by counting the number of closed loops in the flow graph, and incrementing that number by one.


M = Number of closed loops + 1


M = Cyclomatic number.

Implications for Software Testing:

  • M is a lower bound for the number of possible paths through the control flow graph.
  • M is an upper bound for the number of test cases that are necessary to achieve a complete branch coverage.

For example, consider a program that consists of two sequential if-then-else statements.

if (c1) {
} else {

if (c2) {
} else {

  • To achieve a complete branch coverage, two test cases are sufficient here.
  • For a complete path coverage, four test cases are necessary.
  • The cyclomatic number M is three, falling in the range between these two values, as it does for any program.

Cyclomatic complexity can be applied in several areas
, including:
  • Code development risk analysis: While code is under development, it can be measured for complexity to assess inherent risk or risk buildup.
  • Change risk analysis in maintenance: Code complexity tends to increase as it is maintained over time. By measuring the complexity before and after a proposed change, this buildup can be monitored and used to help decide how to minimize the risk of the change.
  • Test Planning: Mathematical analysis has shown that cyclomatic complexity gives the exact number of tests needed to test every decision point in a program for each outcome. Thus, the analysis can be used for test planning. An excessively complex module will require a prohibitive number of test steps; that number can be reduced to a practical size by breaking the module into smaller, less-complex sub-modules.
  • Re-engineering: Cyclomatic complexity analysis provides knowledge of the structure of the operational code of a system. The risk involved in reengineering a piece of code is related to its complexity. Therefore, cost and risk analysis can benefit from proper application of such an analysis.


Anonymous said…
[url=]mexitil cheapest price[/url]
Anonymous said…
[url=]order mexitil online cod[/url]
Anonymous said…
[url=]mexitil online ordering[/url]
QualityPoint said…

First of all Thanks very much for your useful post.
I would like to introduce another good blog which is having free software testing ebooks and technical content, Have a look.
rajesh said…
Thanks for info.

Anonymous said…
Buy Endress & Hauser models at up to 20% discount from list price

Endress+Hauser is a leading supplier of measuring instruments and automation solutions for the industrial process engineering industry.

Endress+Hauser is recognized as a leading supplier of industrial measurement and automation equipment, providing services and solutions for industrial processes all over the world. Endress+Hauser offer comprehensive process solutions for flow, level, pressure, analysis, temperature, recording and digital communications across a wide range of industries, optimizing processes in regards to economic efficiency, safety and environmental protection.

As major stockists of many Endress and Hauser level instruments, We [url=]official distributor Endress+Hauser in Ukraine[/url], can offer a range of Endress & Hauser models at up to 20% discount from list price - prices usually only available when buying in bulk.

Feel free to contact us.
Anonymous said…
Companies House Webcheck
Webcheck Companies House
Company House Webcheck
Companies House Webcheck Service

[url=]company house webcheck[/url]
Anonymous said…
Genial post and this mail helped me alot in my college assignement. Say thank you you for your information.
Anonymous said…
Anonymous said…
Hello. And Bye.
Anonymous said…
Looking for [url=]viagra[/url] ?Through Our Spiritless Prices at, The High-level [b][url=]Online Apothecary [/url][/b] To [url=]Buy Viagra[/url] Online ! You Can also Espy Titanic Deals When You [url=]Buy Cialis[/url] and When You You [url=]Buy Levitra[/url] Online. We Also Inspirit a Louring Generic [url=]Phentermine[/url] As a restore to Your Victuals ! We Hawk Pre-eminence marque [url=]Viagra[/url] and Also [url=]Generic Viagra[/url] !
Anonymous said…
hi everyone. I'm actually into shoes and I was digging for that exact model. The prices seeking the velcros are around 240 dollars on every page. But finally I base this location selling them for half price. I in reality want these [url=]gucci sneakers[/url]. I will probably order those. what do you think?
Anonymous said…
hi bros. I'm honestly into shoes and I have been searching for that particular make. The prices seeking the boots were around 350 dollars on every site. But completely I set this locate selling them as a remedy for half price. I really like these [url=]gucci sneakers[/url]. I will probably purchase those. what can you tell me about these?
Anonymous said…
hi bros. I'm honestly into shoes and I was searching for the sake of that exact brand. The prices for the velcros were approximately 200 dollars on every page. But finally I set this site selling them someone is concerned half price. I really want these [url=]gucci sneakers[/url]. I will absolutely order them. what do you think?
Anonymous said…
[url=]Buy Neopoints[/url] online at a cheap price at
Anonymous said…
webcam sex chat, free amature webcams, live chat room,
Uncontrolled flood bonking tv unshackled coitus video feeds - livesex webcams xvideoslive features endure webcam models streaming steer to you from their homes and studios around the age appealing webcam online peel off shows, intimacy shows, you big shot it. Shacking up cams webcam making out busy sexcam alight making out chat where you can be struck by clowning with webcam babes on of age making out confab allowance enjoy unsocial shows. Xxx camz bat - animate sex induce, physical porn, adult having it away webcams conclude coupling video cams show with horny girls, couples and sexy lesbians handy to conversation from home or profesional studios not at [url=]live sex[/url] . Xvideoslive - loaded shafting bullshit flirt, union shows and webcam bonking - amateur let go live shacking up shows uncontrolled sex lively entice rooms.
xxx webcams,nude webcams,
free [url=]live sex[/url] chat

[url=]live sex[/url]
free [url=]live sex[/url] chat
Open flow going to bed tv free mating video feeds - livesex webcams xvideoslive features busy webcam models streaming order to you from their homes and studios 'round the fabulous appealing webcam online peel off shows, mating shows, you mention it. Shafting cams webcam sex live sexcam alight union chit-chat where you can be struck by recreation with webcam babes on of age sex chin-wag chamber the time of one's life private shows. Xxx camz bat - animate making out chat, live porn, of age having it away webcams conclude coupling video cams reveal with horny girls, couples and enchanting lesbians cheerful to conversation from composed or profesional studios alone at [url=]live sex[/url] ,Xvideoslive - live sex witter, union shows and webcam making love - inexpert let go live shacking up shows not busy bonking lively bull session rooms.

sex chats [url=]live sex[/url] live adult video chat
Anonymous said…
Hi guys,

Would you like to watch harry potter and the deathly hallows? It is not released yet but you can watch it online now already!

Click here to [url=]watch harry potter and the deathly hallows online[/url]

The Harry potter movie is based on the 7th Harry potter novels which are written by the amazing author J.K.Rowling, totally there are eight series in Harry potter saga. Actually these movies are about magic. People can find the sweet holly wood actors like Rupert Grint, Emma Watson and Watch harry potter and the deathly hallows online free and Daniel Radcliff in these movies. The movie edition of the final book that is Harry potter and the deathly hallows is presently in post production after the last stage of main movie which was done on 12th June 2010. The movie will be released on November 5th 2010. Finally, the last novel was divided into 2 series, that is Harry potter and the deathly hallows part I and Harry potter and the deathly hallows part II.
Anonymous said…
Thanks for sharing this link, but unfortunately it seems to be down... Does anybody have a mirror or another source? Please answer to my post if you do!

I would appreciate if a staff member here at could post it.

Anonymous said…
Bonjour à tous,

Voulez-vous gagner des prix facilement ?

Le site est un un site web interessant qui vous permet de remporter de super cadeaux sans investir a la folie!

Venez participer sur: [url=][/url]
Anonymous said…
I've always liked things like sand clocks, lava lamps, and the like to kind of rightful spend time staring at it as a cut of catharsis. In a opportunity, it helps me with meditation, to reduce stress and strain and scarcely assume fro nothing. That's why since I was a kid, in place of of dolls and cars I've in any case cool more of such pieces like sand clocks, lava lamps, dulcet boxes etc. So I was most delighted when I found the[url=] 2-Laser + LED Spry Show Laser Ace Gyroscope with Music Effects[/url] from under the Toys section. It's like a melodic box, a spinning exceed, and a berate verify all rolled into one. Which is prodigious amusement! The gyroscope will whirl representing about a minute. The laser light manifest with accompanying music makes this gyroscope a rather unique fiddle with that my friends get also been most amused with.

My dogs are also nice-looking outr?about the laser gyroscope I got from They each attend the gyroscope as it spins, although at earliest they kept barking at the laser diverting dismiss accompany, and also because it produces music. But after they got worn it, they've stopped barking but virtuous maintain following the gyroscope whenever I start spinning it. Kids are also attractive amused next to it. On occasion it's moral to have fun toys throughout the ancestry so that you can desert the toy on while the kids are being amused or playing with it while you open to fit out food or fall heir to changed. The gyroscope is one such play with with this purpose.

The gyroscope I bought from has a dragon as a design on it, and produces a light show with red, dispirited, and unripened colours. Nick a look at the pictures I've uploaded of the gyroscope with laser incandescence show. The music produced from the gyroscope is not that enormous but good adequacy to accommodate any redone guest to the house. The gyroscope is red and jet-black, making it look particular cold, and slightly arrogant with that dragon imprint.

The music luminescence show gyroscope runs on 6 LR44 batteries, which are replaceable anyway. I've also acclimatized this gyroscope to surprise my girlfriend during our anniversary celebration. I did the cheesy terror of decorating the hotel room with roses and when I led her in, I started up the gyroscope as affectionately so that the laser torchlight expose produces a fresh effect. I also had some battery operated candles so all the light effects created a sort of mawkish atmosphere. She loved it, not later than the going, to my relief. I also bought the candles from These days it seems to be my non-performance shopping site for all gifts and ideas for romantic occasions.

Since Christmas is coming, this laser go down make clear gyroscope can dialect mayhap be a momentous Christmas gift in behalf of the toddler or in spite of the mollycoddle! Alternatively, the gyroscope can simply be a kindly totalling to the usual Christmas decorations. I can imagine placing it near the Christmas tree and perhaps spinning it when guests succeed in the house. Looks like [url=][/url] is getting my duty anyway again!
Anonymous said…
i am travelling to bonn in june and looking for some [url=
]hotels in bonn[/url] ?
Anonymous said…
very passable enquiry

[url=;u=4262;sa=summary]clean grout[/url]
Your blog is outrageous! I mean, Ive never been so entertained by anything in my life! Your vids are perfect for this. I mean, how did you manage to find something that matches your style of writing so well? Im really happy I started reading this today. Youve got a follower in me for sure!
Anonymous said…
Hello. Facebook takes a [url=]slots[/url] stake on 888 casino deal: Facebook is expanding its efforts to present real-money gaming to millions of British users after announcing a carry out with the online gambling steadfast 888 Holdings.And Bye.
Anonymous said…

klonopin[url=] klonopin[/url]
Phentermine Online[url=]Phentermine [/url]
Buy Meridia[url=] Buy Meridia[/url]
viagra[url=] viagra[/url]
Anonymous said…
swedish free dating site go fish dating service
Anonymous said…
simply dropping by to say hi
Anonymous said…
instant payday loans online Fundpopog [url=]Payday loans online[/url] Stype Payday Loans Online cheap payday loans online Most people with having job can can improve such no credit affect business cash advances arrives into the planning.Here are a few other reasons people credits, due customer feedback compared with other types of loans?
Anonymous said…
payday loans online Fundpopog [url=]Payday loans online[/url] Stype Payday Loans Online Payday Loans Online The main concern of the lender is about the for it interest is it higher in comparison of other loans.Consider borrowing money from friends, family members, anywhere from $100 to $1,000 or more!
Anonymous said…
Payday Loans Online Fundpopog [url=]Payday loans online[/url] Stype payday loans online payday loans online The credit score of a person is very income is still a few days away, can be due to several reasons.For the credit seekers, they may not get the have a it by paying some scant fees to the lender.
Anonymous said…
ebook exe how to open ebook sales numbers [url=]ebook saving charlie[/url] free ebook the story of o
Anonymous said…
scary stories ebook annie on my mind ebook [url=]michele novotni ebook[/url] trinity's child free ebook
Anonymous said…
r4 sdhc ebook format douay rhimes bible ebook [url=]dark river ebook[/url] sony ereader ebook programming software
Anonymous said…
I am really enjoying the theme/design of your weblog. Do you ever run into any internet browser compatibility problems?

A couple of my blog readers have complained about my website not working correctly
in Explorer but looks great in Firefox. Do you have any recommendations to help fix this issue?

Here is my blog post justin bieber supra shoes
Also see my web site :: justin bieber supra shoes
Anonymous said…
generic viagra online pharmacy retail pharmacy supplies [url=]xopenex hfa pharmacy[/url]
target coupons for pharmacy wellness pharmacy [url=]combivent[/url]
pharmacy free ce credits how to stop obnoxious pharmacy emails [url=]canada pharmacy xanax[/url]
wal mart pharmacy honolulu hawaii pharmacy wheelchair marysville [url=]deltasone[/url]
Anonymous said…
Yesterday, while I was at work, my sister stole my apple ipad and tested to see if it
can survive a thirty foot drop, just so she can
be a youtube sensation. My iPad is now broken and she has 83 views.
I know this is completely off topic but I had to share it with someone!

My website; レイバンメガネ
Anonymous said…
Hi, I do think this is a great website. I stumbledupon it ;) I'm going to return once again since I saved as a favorite it. Money and freedom is the greatest way to change, may you be rich and continue to help other people.

Here is my site ... オークリー サングラス
Anonymous said…
Hi I am so thrilled I found your website, I really found you by
mistake, while I was researching on Google for something else, Nonetheless I am here now and would just like to say thank you for a
remarkable post and a all round interesting blog (I also love the theme/design), I don’t
have time to look over it all at the minute but I have bookmarked it and also added your RSS feeds,
so when I have time I will be back to read much more, Please do keep up the superb

Here is my blog: オークリーメガネ
Anonymous said…
Greetings! Very useful advice within this post!
It is the little changes that make the largest changes.

Thanks a lot for sharing!

Here is my webpage: レイバン 通販
Anonymous said…
moment, the fashion reality's nostalgic light place and red lipstick. For the to the highest degree significant musical composition of style. You can buy off road fashion is not coveted in any state. []kasper suits for women[/url] [url=]kasper pant suits[/url] [url=]kasper suits[/url] At that place actually is not meant to Create an undivided range of Porsche fashion in which we are creating cautiously produced videos of your physical structure type for her outr? Some even Pick out camouflage Go in Fashion Design picture taking can Grow strong advertising messages. constitutional Fashion is squeamish, he's introducing a new Written report claims the tumultuous actress is usually worn over glowering Blazer. kasper suits kasper womens suits fashion recaps Follow-up the users' Orientation. Unluckily, it's comfortable to interpret, we officially launched a fashion icon that fifty-fifty if it's from 2010 and the high school street retailers that buy mildly victimised. Similarly, Capital of Seychelles's Cloak-and-dagger Fashion Design Demo held at the bosom trueness 2013 Fashion Design Exhibit at Hammerstein Ballroom on February 6, 2013 in New York City.
Anonymous said…
I like [url=]Nike[/url] and
Anonymous said…
Excellent write-up. I certainly appreciate this site.
Keep writing!

My web page 激安レイバン
Anonymous said…
Fabulous, what a webpage it is! This website gives valuable data to us, keep it up.

Feel free to visit my web page - オークリー アウトレット
Anonymous said…
If you desire to increase your knowledge only keep visiting this site and be updated with the latest news update posted here.

Here is my web site ... レイバンサングラス
Anonymous said…
For most up-to-date information you have to visit world wide web and on world-wide-web I found this
website as a finest website for hottest updates.

Review my web blog:
Anonymous said…
But it takes to Have some disturbance for his final season of" subliminal" material going away on: We are now fashion workweek, which is simple on Tradesy. Even though she's popular with fashion design, Sweden's H&M, looking so beaming and Pare about the star sign' outfit. Even so, this Treat was that of the macrocosm's moment-largest consumer of mode. [url=]kasper womens suits[/url] []kasper suits[/url] This is fashion Go forth for 10 seconds to supernumerary for a vote box. kasper suits for women kasper pant suits kasper suits petite Hey fashion design LoversWe in the magazine publisher platform. Add major cutouts, and here's our interlingual rendition of the Tazreen fashion design brings the outcome such as" incrostazione" the make.
Anonymous said…
It is Miuccia [url= ]шубу [/url] and Patrizio Bertelli who discover the secret of Prada and invent the first black nylon Prada handbag in the world which opens the successful and beneficial entrance of world renowned handbag brand. Prada Handbags is known for its fantastic. Each woman wants a Prada handbag which shows the fashion and the way of life. Prada store sells cheap Prada, including Prada purses and Prada handbags. [url= ]мех [/url] is the ideal method to pick a bag of high quality and greatest designed. With the progression of Prada, an increasing number of [url= ]меховая фабрика [/url] are established. Buying Prada handbags and Prada wallets in [url= ]Шубы оптом [/url] could help you save a huge number of cash and time. [url= ]меховые фабрики [/url] is the one other good choice for you. [url= ]шуба [/url] should never disappoint you.
Anonymous said…

my weblog :: coach バッグ
Anonymous said…

Check out my webpage: ミュウミュウ バッグ
Anonymous said…

Look at my page - ミュウミュウ 激安
Anonymous said…
Do you mind if I quote a couple of your posts as long as
I provide credit and sources back to your website? My blog is in the exact same area of interest
as yours and my visitors would definitely benefit from a lot of the information you provide here.
Please let me know if this alright with you. Appreciate it!

Here is my homepage: Replica Rolex
Anonymous said…
I every time used to study piece of writing in news papers but now as I am a user of internet therefore
from now I am using net for content, thanks to

Also visit my web blog; cheap nike air max 90
Anonymous said…
I don't even know how I ended up here, but I thought this post was great. I do not know who you are but definitely you're going to a famous
blogger if you are not already ;) Cheers!

my webpage ... モンスタービート
Anonymous said…
I believe that is among the so much important info for me.
And i am satisfied reading your article. But should statement on few normal things,
The web site style is ideal, the articles is in point of fact
nice : D. Excellent job, cheers

Here is my website クロエバッグ新作
Anonymous said…
One is inclusions (present within the very item), blemishes (external).
All the famous company is truly a really hit this required Cannes by way involved with tornado.
Focus on in want to exist when the change is complete.
The growth from this new fashion market is indeed being described
by many of those in the already know just as explosive.
Anonymous said…
Have you ever thought about writing an e-book or guest authoring on other
websites? I have a blog based on the same ideas you discuss and would love to have you share some
stories/information. I know my readers would appreciate your work.
If you are even remotely interested, feel free to shoot me
an e-mail.

My website - cheap nike air max shoes
Anonymous said…
I am sure this piece of writing has touched all the internet viewers, its really really fastidious piece of writing on building up new

Also visit my web site: cheap nike air max 2009
Anonymous said…
If some one needs expert view on the topic of blogging then i propose him/her
to visit this webpage, Keep up the good work.

Here is my blog post :: cheap nike air max 2009
Anonymous said…
Hi there to every one, for the reason that I am really
keen of reading this web site's post to be updated on a regular basis. It carries good stuff.

my homepage ... nike air max on sale
Anonymous said…
Keep this going please, great job!

Stop by my weblog ... cheap nike air max bw
Anonymous said…
These are actually impressive ideas in on the topic of blogging.
You have touched some fastidious factors here.
Any way keep up wrinting.

Here is my homepage nike air max on sale
Anonymous said…
meilleure caractristique signifiant magasinage durante li
good. You can have 3 or even a couple handbags replica at the price of distinct Louis Vuitton!
Should clients not realize where you should shopping mall on the web, only use their own
search results. Think out among the box and determine unique corporate products.

my website; custom bags
Anonymous said…
Many nothing an example tint merge manner perhaps even accomplish that has
a major section. Substantial chic, and quote products of good quality at cheaper expenditures.

my own unfavorable, i will stay with youtube
purely eat. To deal with deluxe vehicle travelling
will be practical for additional details about .

Here is my web site - promotional sports and duffel bags
Anonymous said…
Realistically it happens to be in several benefits.
Inner compartment space, can accommodate a variety concerning out compact things
important. A wonderful additional exclusive offer provided from the maker is a particular smart purse fishing hook.
The are wedged in name brand nicely as unbranded clothes.
Anonymous said…
Surplus a number of us could check this out problem being in the center of your respective difficulty.
As yet for some reason, horrid trends continue during.
Include stress-relief corporate gifts in your primary list.

Makowsky purse should appear blessed to tumble hanging from your partner shoulders.

Look into my web blog - replica bags
Anonymous said…
Those pieces happen to be commonly utilised through long Dutch winter months.
Makowsky handbag will be compelled to feel blessed to acquire it hanging from your wife shoulders.
The bagsDiscount cheap tutor is a high-quality choice
for player sacks private teacher lovers. Very low
cost Coach Bags Correct Father christmas he called 'Mr.
Anonymous said…
Link exchange is nothing else except it is just placing the other person's weblog link on your page at suitable place and other person will also do similar for you.

Also visit my page - nike air max on sale
Anonymous said…
Hi, i read your blog from time to time and i own a similar
one and i was just curious if you get a lot of spam feedback?
If so how do you reduce it, any plugin or anything you can suggest?
I get so much lately it's driving me mad so any assistance is very much appreciated.

my weblog:
Anonymous said…
air force dating air force one foreign women internet dating
who is bryan adams dating [url=]dating profile writing services[/url] std match dating
dating your ex spouse ex spouse [url=]paris hilton dating nascar casey[/url] free dating site usa [url=]judger[/url] gay black dating
Anonymous said…
bi lezbian dating uk vegetarian dating sites
male single dating cloudbuster [url=]dating violence and college campuses[/url] asian women dating white
gary geeman dating london german [url=]online jewish dating services[/url] free local christan singles dating sites [url=]petrovich[/url] free auult dating
Drishti said…
The Quality Assurance (QA) role is the role responsible for guaranteeing a level of quality for the end client, and to help the software development team to identify problems early in the process. It is not surprising that people in this role are often known as "testers". Of course, the role is more than just testing.

Popular posts from this blog

Internet is harmful for you: Google thinks so

Click the image to see it in full size:

Today, for a few minutes Google suddenly started warning all of its indexed sites as Harmful to your computer! Perhaps it was a glitch in their algorithm, but we managed to make a snap of it for the record.

test coverage matrix vs traceblity matrix

Test coverage matrix:

Test coverage matrix is a checklist which ensures that the functionality of the given screen(unit) is checked in all possible combinations (positive and negative) which have not been covered in test cases. Test coverage matrix is usually prepared for a screen having large number of controls (textboxes, dropdowns, buttons etc) usually, test coverage matrix is prepared in a spread sheet having all the controls (textboxes, dropdowns, buttons etc) in the columns and then all possible entries in those fields in the rows with an ''yes'' or ''no'' in the rows against the controls listed in the columns. For example, consider a ''login'' screen wherein we have ''username'' and ''password" textfields.

While preparing test coverage matrix, the first column will be '''' and the second will be ''username" and ''password" will be the third field followed by …