SlideShare a Scribd company logo
1 of 16
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
[TestMethod]
public void ExplorePossibleRaceCondition()
{
var random = new Random();
Func<int[]> inputGenerator =
() => new int[] { random.Next(1000),
random.Next(1000),
random.Next(1000) };
Func<int[], string> toString =
n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]);
var stateCalulator = new StateCalulator();
Func<int[], object> raceConditionsFunction =
s=> stateCalulator.Sum(s[0],s[1],s[2]);
Func<int[], object> knownGoodFunction =
f => new StateCalulator().Sum(f[0],f[1],f[2]);
ThreadSafetyTheory.VerifyNoRaceConditions(10000,
inputGenerator, toString,
raceConditionsFunction, knownGoodFunction);
}
ApprovalTests

More Related Content

What's hot

Easy undo.key
Easy undo.keyEasy undo.key
Easy undo.key
zachwaugh
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
Kiyotaka Oku
 

What's hot (20)

Scala on Your Phone
Scala on Your PhoneScala on Your Phone
Scala on Your Phone
 
Easy undo.key
Easy undo.keyEasy undo.key
Easy undo.key
 
Introduzione a .NET / Mono
Introduzione a .NET / MonoIntroduzione a .NET / Mono
Introduzione a .NET / Mono
 
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.9 book - Part 71 of 210
 
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31
 
The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.8 book - Part 74 of 202The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.8 book - Part 74 of 202
 
The Ring programming language version 1.6 book - Part 55 of 189
The Ring programming language version 1.6 book - Part 55 of 189The Ring programming language version 1.6 book - Part 55 of 189
The Ring programming language version 1.6 book - Part 55 of 189
 
The Ring programming language version 1.10 book - Part 64 of 212
The Ring programming language version 1.10 book - Part 64 of 212The Ring programming language version 1.10 book - Part 64 of 212
The Ring programming language version 1.10 book - Part 64 of 212
 
The Ring programming language version 1.6 book - Part 69 of 189
The Ring programming language version 1.6 book - Part 69 of 189The Ring programming language version 1.6 book - Part 69 of 189
The Ring programming language version 1.6 book - Part 69 of 189
 
The Ring programming language version 1.7 book - Part 72 of 196
The Ring programming language version 1.7 book - Part 72 of 196The Ring programming language version 1.7 book - Part 72 of 196
The Ring programming language version 1.7 book - Part 72 of 196
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Property Based Testing
Property Based TestingProperty Based Testing
Property Based Testing
 
The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.5.1 book - Part 65 of 180The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.5.1 book - Part 65 of 180
 
The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.9 book - Part 78 of 210The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.9 book - Part 78 of 210
 
The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.4.1 book - Part 13 of 31The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.4.1 book - Part 13 of 31
 
The Ring programming language version 1.6 book - Part 64 of 189
The Ring programming language version 1.6 book - Part 64 of 189The Ring programming language version 1.6 book - Part 64 of 189
The Ring programming language version 1.6 book - Part 64 of 189
 
Introduction to Unit Testing (Part 2 of 2)
Introduction to Unit Testing (Part 2 of 2)Introduction to Unit Testing (Part 2 of 2)
Introduction to Unit Testing (Part 2 of 2)
 
The Ring programming language version 1.5.4 book - Part 67 of 185
The Ring programming language version 1.5.4 book - Part 67 of 185The Ring programming language version 1.5.4 book - Part 67 of 185
The Ring programming language version 1.5.4 book - Part 67 of 185
 
The Ring programming language version 1.10 book - Part 74 of 212
The Ring programming language version 1.10 book - Part 74 of 212The Ring programming language version 1.10 book - Part 74 of 212
The Ring programming language version 1.10 book - Part 74 of 212
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 

Viewers also liked

Viewers also liked (13)

Approval testing from basic to advanced
Approval testing   from basic to advancedApproval testing   from basic to advanced
Approval testing from basic to advanced
 
Strategy agile games 2015
Strategy   agile games 2015Strategy   agile games 2015
Strategy agile games 2015
 
The curse of knowledge
The curse of knowledgeThe curse of knowledge
The curse of knowledge
 
Lean coffee
Lean coffeeLean coffee
Lean coffee
 
Increase testability with code seams
Increase testability with code seamsIncrease testability with code seams
Increase testability with code seams
 
Exploratory and Unit Testing
Exploratory and Unit TestingExploratory and Unit Testing
Exploratory and Unit Testing
 
Advanced unit testing
Advanced unit testingAdvanced unit testing
Advanced unit testing
 
The curse of knowledge
The curse of knowledgeThe curse of knowledge
The curse of knowledge
 
Mob testing
Mob testingMob testing
Mob testing
 
Intentional code
Intentional codeIntentional code
Intentional code
 
Getting existing code under tests
Getting existing code under testsGetting existing code under tests
Getting existing code under tests
 
Strong Style Pairing
Strong Style PairingStrong Style Pairing
Strong Style Pairing
 
10x
10x10x
10x
 

Similar to Thread base theory test

생산적인 개발을 위한 지속적인 테스트
생산적인 개발을 위한 지속적인 테스트생산적인 개발을 위한 지속적인 테스트
생산적인 개발을 위한 지속적인 테스트
기룡 남
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
anwarsadath111
 

Similar to Thread base theory test (20)

Property-based testing
Property-based testingProperty-based testing
Property-based testing
 
Data in Motion: Streaming Static Data Efficiently
Data in Motion: Streaming Static Data EfficientlyData in Motion: Streaming Static Data Efficiently
Data in Motion: Streaming Static Data Efficiently
 
생산적인 개발을 위한 지속적인 테스트
생산적인 개발을 위한 지속적인 테스트생산적인 개발을 위한 지속적인 테스트
생산적인 개발을 위한 지속적인 테스트
 
The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88
 
The Ring programming language version 1.5.3 book - Part 77 of 184
The Ring programming language version 1.5.3 book - Part 77 of 184The Ring programming language version 1.5.3 book - Part 77 of 184
The Ring programming language version 1.5.3 book - Part 77 of 184
 
Ruslan Shevchenko - Property based testing
Ruslan Shevchenko - Property based testingRuslan Shevchenko - Property based testing
Ruslan Shevchenko - Property based testing
 
code for quiz in my sql
code for quiz  in my sql code for quiz  in my sql
code for quiz in my sql
 
The Ring programming language version 1.5.2 book - Part 65 of 181
The Ring programming language version 1.5.2 book - Part 65 of 181The Ring programming language version 1.5.2 book - Part 65 of 181
The Ring programming language version 1.5.2 book - Part 65 of 181
 
Monadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query ExpressionsMonadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query Expressions
 
Swift 함수 커링 사용하기
Swift 함수 커링 사용하기Swift 함수 커링 사용하기
Swift 함수 커링 사용하기
 
Ann
AnnAnn
Ann
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
Java 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR BeneluxJava 8 - Nuts and Bold - SFEIR Benelux
Java 8 - Nuts and Bold - SFEIR Benelux
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
 
.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
 
Tupple ware in scala
Tupple ware in scalaTupple ware in scala
Tupple ware in scala
 
The Ring programming language version 1.5.2 book - Part 52 of 181
The Ring programming language version 1.5.2 book - Part 52 of 181The Ring programming language version 1.5.2 book - Part 52 of 181
The Ring programming language version 1.5.2 book - Part 52 of 181
 
WOTC_Import
WOTC_ImportWOTC_Import
WOTC_Import
 
Ocr code
Ocr codeOcr code
Ocr code
 

More from Llewellyn Falco

Koans randori role cards
Koans randori role cardsKoans randori role cards
Koans randori role cards
Llewellyn Falco
 
Teaching kids programming with the Intentional Method
Teaching kids programming with the Intentional MethodTeaching kids programming with the Intentional Method
Teaching kids programming with the Intentional Method
Llewellyn Falco
 

More from Llewellyn Falco (17)

Lets connect linked_in
Lets connect linked_inLets connect linked_in
Lets connect linked_in
 
Test driven development done well
Test driven development done wellTest driven development done well
Test driven development done well
 
Do not use the greater than sign in programming
Do not use the greater than sign in programmingDo not use the greater than sign in programming
Do not use the greater than sign in programming
 
Cutting code quickly
Cutting code quicklyCutting code quickly
Cutting code quickly
 
The falco technical coaching framework
The falco technical coaching frameworkThe falco technical coaching framework
The falco technical coaching framework
 
Expressive objects
Expressive objectsExpressive objects
Expressive objects
 
Roi on learning hour
Roi on learning hourRoi on learning hour
Roi on learning hour
 
Mob programming
Mob programmingMob programming
Mob programming
 
Developing design sense of code smells
Developing design sense of code smellsDeveloping design sense of code smells
Developing design sense of code smells
 
Exceptional exceptions
Exceptional exceptionsExceptional exceptions
Exceptional exceptions
 
Koans randori role cards
Koans randori role cardsKoans randori role cards
Koans randori role cards
 
Teaching kids programming with the Intentional Method
Teaching kids programming with the Intentional MethodTeaching kids programming with the Intentional Method
Teaching kids programming with the Intentional Method
 
How Games Teach
How Games TeachHow Games Teach
How Games Teach
 
Some Helpful Observations for successful Mob Programming
Some Helpful Observations for successful Mob ProgrammingSome Helpful Observations for successful Mob Programming
Some Helpful Observations for successful Mob Programming
 
State of teaching in video games
State of teaching in video gamesState of teaching in video games
State of teaching in video games
 
Do it yourself Code Report (blank)
Do it yourself Code Report (blank) Do it yourself Code Report (blank)
Do it yourself Code Report (blank)
 
The code report (v1)
The code report (v1)The code report (v1)
The code report (v1)
 

Recently uploaded

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 

Thread base theory test

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 6. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 7. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 8. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 9. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 10. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 11. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 12. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 13. [TestMethod] public void ExplorePossibleRaceCondition() { var random = new Random(); Func<int[]> inputGenerator = () => new int[] { random.Next(1000), random.Next(1000), random.Next(1000) }; Func<int[], string> toString = n => string.Format("{0} + {1} + {2} = ", n[0], n[1], n[2]); var stateCalulator = new StateCalulator(); Func<int[], object> raceConditionsFunction = s=> stateCalulator.Sum(s[0],s[1],s[2]); Func<int[], object> knownGoodFunction = f => new StateCalulator().Sum(f[0],f[1],f[2]); ThreadSafetyTheory.VerifyNoRaceConditions(10000, inputGenerator, toString, raceConditionsFunction, knownGoodFunction); }
  • 14.
  • 15.