HTML5 canvas and BDD - Cucumber - 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 :)

Related

How to create a web application framework

I want to attempt creating a framework like Ruby on Rails but for Rust. I know it will take long and it's a lot of work but I figured it would help me better understand the abstractions that are used in frameworks and reasoning behind framework developers' decisions. By building a framework I will also get to learn lots about the framework I'm building. The only projects I've created with Rust is Philip Opperman's Rust OS, a Ray Tracer and a sudoku game using the Piston engine. Can anyone give me some tips/pointers on how to go about this project or where to start? I want to build it specifically for API development.

How well would MvvmCross and CSLA.net work together in a multi-platform strategy (ASP.NET MVC, WP, WPF, WinRT, Win8, Android, iOS)

Long time lurker, first time questioner here :)
I have been looking into our company's next software system architecture. We have been using CSLA.net, to some extent, as our business object framework and are thinking of building our new architecture around it. CSLA.net has support for the platforms mentioned in the title and we are looking for mvvm framework that would work well with it.
At the moment we only support windows environments but are also looking to support at least Android and iOS (also mono in general is under consideration). We are looking to share as much of the code as possible between the platforms and MvvmCross seems like really nice piece of mvvm (+) framework, especially in that context. I have watched few n+1 videos and what I have seen so far has been very impressive. I also like the Stuart's style of introducing the framework and concepts around it.
Has anyone tried to build a cross platform application that uses both of these frameworks (CSLA.net and MvvmCross)? If yes, what have been your experiences like? Also if Stuart could comment on the issue of how to merg the viewmodels of the two frameworks. I remember Rocky (Rockford Lhotka) recommending, as a general tip when working with mvvm frameworks, to inherit CSLA.net viewmodelbase(not viewmodel) and implement also mvvm framework's requirements into that class. You can find source of the viewmodelbase from https://github.com/MarimerLLC/csla/blob/master/Source/Csla.Xaml/ViewModelBase.cs.
Any input would be much appreciated.
Regards,
Harri
ps. I think, that this would make a great n+ video. Wouldn't it ;)
I've personally never used CSLA, but I have talked with it's original author, Rocky, both by email and in person.
CSLA presents itself as a business model object layer and that it can very successfully interoperate with independent Mvvm frameworks - see Rocky's post on CSLA+Mvvm
MvvmCross provides the more application and UI level support - and leaves application authors free to choose how they write their business services and models.
Because of this, yes I think it should be possible and even straight-forward to use both of the frameworks together if you want to. To get started, it might be useful to write some prototypes - and perhaps to look at the way other integration has been done - e.g. CSLA+Caliburn integration
ps. I think, that this would make a great n+ video.
I'd much rather see this type of article from someone who understands and uses CSLA. I would encourage all members of the MvvmCross community to contribute their own blog posts, articles, videos and github samples.
One caveat to this advice: I don't know if CSLA support Portable Class Libraries - if it doesn't then you'll probably need to use file-linking rather than PCLs in your app
Yes, you can use a multitude of MVVM frameworks; I've used CaliburnMicro and our own custom MVVM with success. If you haven't checked out Rocky's eBook series, you should definitely do so. One of the big gotchas is the limitations on reflection in Silverlight, hence also in WP8 and WinRT, so some reading up on that is well-advised.
Regarding Portable Class Libraries, you can't those for CSLA business objects (they require more stuff than is available in PCLs), so you do have to do the project linking. Typically, write the complete class in the .NET libary w/ pre-compiler directives, such as
#if !SILVERLIGHT
around code that can't be complied for Silverlight/WP8. I do use PCLs for some basic stuff, like enums and constants, but not for the business classes.
Xamarin have just released some updates that mean the latest framework 4.5 with async features can shortly be implemented...

Porting Windows Phone game with Xamarin

I currently have a very simple memory game for Windows Phone that I would like to port over to iOS, Android and possibly Win8 using Xamarin tools.
I would like to centralize my business logic in one assembly and simply create the UI for each platform.
For the most part, the code is simple C#, but I do make use of Bitmaps to show the cards in the game. However, from what I've read, there is no standard support across the different platforms for using Bitmaps.
What would be a recommended approach to this problem?
I'm thinking I have to use something like MonoGame, but feel that is overkill for what I want to do.
You say your code is in C#. As far as I know Xamarin is the only way to get C# code to run on Android and iOS. Xamarin has a free starter edition that you might be able to use but your app will be size limited. Once you hit the size limit you'll need to pay for a license.
After you've decided to pay for a license there are no other costs involved if you want to use MonoGame for the port. If your game is already using XNA or you have some XNA experience I recommend using MonoGame. MonoGame is a port of XNA and is designed for making games, so many game related tasks are easier.
The alternative is to build your game as an app using the standard app building API. This is possible but I can't see any advantages doing it this way unless you are trying to save money by using Xamarin's free edition. If you plan to make more games in the future, you'd be better off biting the bullet and learning MonoGame.
Using bitmaps with MonoGame shouldn't be a problem. Although, you may need to convert them to PNG's first.
Centralizing the business logic in one assembly is sort of possible using Portable Class Libraries but due to the limitations of PCL's it's often easier to use file sharing. Basically you have a soft link to the files in each project. Updating the files updates them in all projects at the same time, but adding new files requires you to add them to each project individually. It's a little bit of a maintenance pain, but not much.
For sure, as a starting point you should separate UI and logic.
To reach this I highly recommend you to make console version of game. Using console it is possible only send commands with parameters to application. No mouse or real-time keyboards usages. All UI-related tasks will be left. Only business logic and commands to use will remain.
Then, you should try MonoGame. It's reliable enough for 2D games. Even more, If IL-code is not too much, it's free for iOS and Android!
Other way is... Unity 3D. Using that engine is depends of code you wrote. In some cases it's possible to use that game engine with shared business logic. Thanks to new Unity 3D policy, indie game developers could make and deploy their games for free.
In short, plan is:
Implement core functionality (with console I/O);
Then, choose engine and implement UI for target platforms.

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.

Best choice to build a website like http://www.pageflakes.com/

What is the best language and approach to build the widgets website like http://www.pageflakes.com/. By best I mean rapid development, performance, smoothness and by approach I mean that some one will use drag and drop plug in jQuery (some issues) etc.
Two functionality will be main in my site:
selecting the widget and then dragging on the specified position i like
saving the state without login for the user.
You don't mention your existing language skills which might be the most important detail here. Also, are you prepared to learn a new language/framework for this project?
Some generic advice assuming you would be using Java: since the site in consideration looks more like a web application as opposed to a "web site", a framework which supports rich controls/Ajax natively might work wonders here. A GWT based framework like SmartGWT might be an interesting candidate.

Resources