Comments (4)
(See VBA-Dictionary for example)
from vba-test.
I don't personally agree with performance benchmarking to be part of a testing framework; for that you have benchmarking suites like Benchmark.js. The role of TDD/BDD is to improve the software's design and raise code quality; not to ensure your code is fast.
I do agree that it would be handy to have test execution profiling and think it should be built into the SpecDefinition class so you can determine which tests are the slowest, however I'm finding it hard to find an elegant way of adding such functionality since the actual values are executed during Spec creation.
Maybe:
With Specs.It("should add an item")
Set Dict = CreateDictionary(UseNative)
.StartTimer
Dict.Add "A", 123
.Expect(Dict("A")).ToEqual 123
.StopTimer
End With
which doesn't look that elegant... Or maybe:
With Specs.It("should add an item")
Set Dict = CreateDictionary(UseNative)
.Given(MyDict, "Add").WhenCalledWithArgs("A", 123).Expect(MyDict("A")).ToEqual 123
' Other examples could be:
' .Given("Callback").WhenCalled().Expect("...").To...
' .Given(MyObj, "Function").WhenCalled().Expect("...").To...
' and if you really need to:
' .Given("MySubroutine").WhenCalled().LogTime
End With
which is easier to read, but makes me feel icky for some reason.
from vba-test.
@robodude666 Thanks for the comments! The second example is interesting, I'll ponder this more. I agree, this is out of scope for Excel-TDD, the goal was more to make sure that Excel-TDD provided some sort of foundation for enabling it.
from vba-test.
It's been quite a while and I'm thinking this should be a separate library. There's no good way to get a pass or fail out of a speed test and I'd prefer to keep this library simpler.
from vba-test.
Related Issues (20)
- spy/mocks? HOT 3
- Add IsTrue() IsNotTrue() IsFalse() IsNotFalse() HOT 2
- Need more explanatory examples HOT 4
- IsEqual does not support Array Types HOT 2
- SpecDefinition should return its own reference HOT 2
- Provide a 'toBeCloseTo' matcher for precision math comparison HOT 3
- Asserting Err Object HOT 1
- Fail suite for unhandled error
- Run Test Suite classes with method per test HOT 6
- TestFixture() class as part of block?
- WorkbookReporter should be able to create it's own output sheet
- ArrayIncludes() cannot handle multi-dimension arrays HOT 1
- Function Examples end as Sub HOT 2
- Which documentation generator do you use?
- Possible memory leak?
- VBA testing HOT 1
- Update Workbook proxy HOT 1
- Plan: Update runners HOT 2
- AfterEach HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vba-test.