Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FEATURE REQUEST - Automated unit testing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FEATURE REQUEST - Automated unit testing

    NT Team,

    Please develop automated unit testing in NT8. Where tests could operate under:
    - Calculation.OnBarClose, and Calculation.OnEachTick, and
    - State.Realtime and State.Historical.

    In the words of reach4thelasers "Unit tests are crucial for an application of this nature: it is financial in nature and contains a ton of math" (Making NinjaScript Development Unit Testable).

    For the benefit of forum members (MSDN - Unit test basics) or (Mark's Devblog - The fundamentals of unit testing) :
    The AAA (Arrange, Act, Assert) pattern is a common way of writing unit tests for a method under test.
    - The Arrange section of a unit test method initializes objects and sets the value of the data that is passed to the method under test.
    - The Act section invokes the method under test with the arranged parameters.
    - The Assert section verifies that the action of the method under test behaves as expected.
    Noting the team at NT are the experts, I believe automated unit testing would require the ability to :
    - mock price ticks, where mock ticks behave the same as real tick events (i.e. they cumulate into bars with properties like FirstTickOfBar and FirstBarOfSession),
    - record (or create) a mock tick series (e.g. ^SP500 1 October - 31 October 2017),
    - insert (or reference) a mock tick series in the Arrange section of a unit test, and
    - raise events (i.e. tick events) based on the mock tick series.

    What ever the implementation, please develop automated unit testing in NT8.

    Thanks
    Shannon

    #2
    Hello Shansen,

    Thank you for your post.

    I will send your request to our development team.

    Comment


      #3
      Hello Shansen,

      The internal tracking number for your feature request is SFT-2793. Please reference this internal tracking number if you ever have questions regarding this feature request.

      Comment


        #4
        Shansen,

        We do the same internally at NinjaTrader but do not have any 'official' automated test suite developed. What we do is just use the Tools > Historical Data -> Import tool to import a consistent set of 'fake' ticks which we've built to test something using excel. We import that in to a test symbol then simple run the NinjaScript on this consistent test data and test symbol. You could build a strategy that does the same and you can enable and disable it when you want to do TDD.

        I don't see us adding test driven development tools in the near future which is why I wanted to make sure to FYI you on the technique we use internally which could be applied now.

        -Brett

        Comment


          #5
          Brett & PatrickH,

          Thank you for your patience and ideas towards a workable approach (including PatrickH's post).
          Pressing further, a post demonstrating the end to the end process would be invaluable, perhaps in the Reference Samples or Tips section.

          Again, thanks
          Shannon

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by KennyK, 05-29-2017, 02:02 AM
          2 responses
          1,278 views
          0 likes
          Last Post marcus2300  
          Started by fernandobr, Today, 09:11 AM
          0 responses
          0 views
          0 likes
          Last Post fernandobr  
          Started by itrader46, Today, 09:04 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by timmbbo, Today, 08:59 AM
          0 responses
          2 views
          0 likes
          Last Post timmbbo
          by timmbbo
           
          Started by bmartz, 03-12-2024, 06:12 AM
          5 responses
          33 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Working...
          X