How to do TDD using Pex for SharePoint based application - sharepoint

I am working on creating an application which is based on SharePoint Foundation 2010. I'm looking for a way to take advantage of the TDD methodology. While reseacrhing for TDD I read about Pex and Moles. Can anyone advice on what is the best approach to implement TDD for a SharePoint based custom solution. Please provide links to relevant articles or videos which can help.

It is not possible to use PEX for TDD. TDD requires you to write a failing test first, then write code to make the test pass. PEX requires you to write code first, then it generates tests for you. Something like NUnit is more suitable for TDD on .NET. Sorry, I don't know enough about SharePoint to comment on anything specific that it requires.

Related

How to learn Netsuite SuiteScript

I have worked on Net-suite Suite Talk web services.Now i want some customization on my account using suite script.
I am adding checks to Net suite and check have some items.I want to add those items to deposit section.
user will select the check from drop down on Deposit page.
List of item will be displayed and user can check those to upload to deposit section.
How can i do that and how can i learn suite script to complete this task?
Thanks in advance.
HItesh Kumar
The best way to learn it is to RTFM. Although the SuiteAnswers documentation is far from being the best, it is a good place to start. After that, read the API file & get to know the API. Once you have a good, practical understanding of the APIs, then work with the code in the debugger.
Aside from that, you would need to add your current code in your questions, and the errors that you are receiving.
Those could be useful however if you try to learn SuiteScript 2.0 which I recommend because SuiteScript 1.0 will no be longer supported, then the API Doc is not very useful because the examples are very short and even with errors.
The best resource I found so far is:
https://stoic.software
Very professional guy with good knowledge, expertise and good prices.

HTML5 canvas and BDD - Cucumber

I was learning about Behavior driven development (BDD) recently, i see that its good for CRUD web application.
Is BDD tools such as Cucumber suitable for games, specifically are they good for HTML5 Canvas games?
Is there any other BDD tools for HTML5 canvas games? Or Is BDD only for CRUD applications?
I've just recently been experimenting with BDD and Games Development. But I'm building on the .NET & XNA Frameworks with C#. I'm using Visual Studio as my IDE and testing with SpecFlow and NUnit.
SpecFlow is the BDD/Gherkin tool - and as a group we've been talking about the game and fleshing out some requirements and documenting them in Gherkin... and going from there. The key is designing the game to be testable.
We've abstracted the game engine away from main "game loop" implementation that XNA requires so we are able to load it up and inject all of the dependencies it requires. We then run the tests on the engine and make asserts on the code afterwards to make sure that it is behaving correctly.
We decided early on that Graphics/Drawing/Sound/etc were out of scope of the testing... if they were broken in the end product, it would be very obvious. The test suite we've managed to build up just gives us the confidence that the mechanics of the game itself are working as intended (i.e. is game object A in the right location? does game object B die when hit with projectile C? etc. etc.).
So far it has been quite a good experience.
The question is: can you think of ways to interact with the canvas-based game in JavaScript?
Practically, could you open the JS console and interact with the game from there? Can you fire clicks at the right coordinates, can you press keys and most importantly, can you make assertions on what's being output by the game?
If the answer is yes, then you are able to automate the game in JavaScript and either Cucumber or Cucumber.js can definitely be used on top of that.
If the answer is no and you can't figure out a way to automate the canvas content in a similar fashion than what described above, then I'm afraid no automation tool could do the job.
To answer your second question: BDD has absolutely nothing to do with "CRUD" applications. It's about describing behaviours and automating examples that illustrate those behaviours. You can therefore take a BDD approach on virtually any types of application.
Shouldn't you find a way to automate your application, you could still consider writing scenarios to document the (expected) behaviour of your app. The automation phase is not mandatory, contrary to common beliefs :)

Is there any best practice/guidelines available for using Code Contracts, Pex and 'Fake' framework?

Is there any best practice/guidelines available for using Code Contracts, Pex and Fake framework? Not able to find something concrete available with all 3 combined.
PEX site provides a bunch of documentation for using PEX and Code Contracts.
Your entry point probably will be Getting Started With Microsoft Code Contracts and Pex .
They also have good Moles documentation Microsoft Moles Reference Manual
Martin Angler has a great introductory article on Code Contracts & Pex: Assertions and Assumptions
There are also good workshops on this topic:
Code Contracts and Pex: Power Charge Your Assertions and Unit Tests
Microsoft PEX/MOLES & advanced Unit-Testing aspects (3 parts)
Manuel Fahndrich and Peli de Halleux - The Synergy of Code Contracts and Pex 10-minute note from PEX designers
The Visual Studio ALM Rangers are working on guidance for Microsoft Fakes. I'd be very interested in hearing from users who have adopted it, been scared off, success stories, tips, failures.... etc. drop me a mail at fakes#freetodev.com
I'll post a link here to our guidance as soon as we start shipping.
Mike

Automated testing for an MFC based user interface

I am looking to run a load of automated functionality tests on a user interface application of mine and was wondering what is the best software out there to carry out these tests. Preferably the software will be able to intergrate with Visuall C++ 2005. I have googled various software however there is so much out there I'm not sure what is best for what I need. Any help would be awesome, thanks.
for automated software unit tests I would recommend google test. There is a very good q&a on this platform, which you can find here.
Additionally, there is CPPUnitLite, which is developed by the author of "Working Effectively with Legacy Code", Michael Feathers.
I used AutoIt Scripts for testing a MFC application just a little bit, but it was not that easy to maintain them properly and build an effective logging system for failed tests.
However, the unit tests depend heavily on the architecture of your program and the structure of your class - especially the dependencies to other components / classes. So if you already have an existing MFC application, which was not built with unit tests in mind, you probably have to refactor a lot of things. Therefore, I would recommend the mentioned book. You can also use the classic "Refactoring" by Martin Fowler.
Did you take a look at AutoIt? It's a generic GUI scripting language which can also be used from C++/C#. I'm using it to automate parts of testing a Visual Studio addin.

compare sharepoint with java world

I am a good java web developer having knowledge of numbers of technical issues in java industry.
I heard lot about SharePoint. I don't able to understand it because I don't have idea of workings in Microsoft world.
Can someone tell about SharePoint by taking a scenario from java world.
Central repository for what? Not really. No offence but you really need to do a bit more reading first. Try
What is Sharepoint
Microsoft SharePoint - Wikipedia
SharePoint product information page
Can someone tell about SharePoint by taking a scenario from java world.
There isn't a direct correlation to Java. SharePoint is an application, Java is a programming language. It's like asking someone to describe Microsoft Excel in terms of the PHP world - doesn't really make sense as a question.
However, Alfresco is an OSS project is similar to SharePoint and written in Java.
How does it differ from Mircosoft Visual Studio Software
VisualStudio is an Integrated Development Environment (IDE), like Eclipse.

Resources