Coder Social home page Coder Social logo

Comments (4)

timhall avatar timhall commented on September 21, 2024

(See VBA-Dictionary for example)

from vba-test.

robodude666 avatar robodude666 commented on September 21, 2024

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.

timhall avatar timhall commented on September 21, 2024

@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.

timhall avatar timhall commented on September 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.