Testing Domain specific languages - dsl

I have developed a graphical domain specific language. I want to use this for model based design. I have a number of graphical components which have abstract information about the domain and these components are used to implement my algorithms.
Can anyone please tell me if there is an alternative to conventional unit testing for testing these graphical components. Unit testing these blocks is fairly straight forward, but I feel its quite time consuming and redundant for my application. Hence, I am looking for alternatives.
Any suggestion will be appreciated.
Thanks

Simplest way is to use tools for creating graphical domain-specific languages. Those tools not only help in defining the language, but also provide built-in checks and the best allow you to test your language while you define it at the same time. For a survey on these tools see http://www.languageworkbenches.net/past-editions/

This depends on the technology that you used to create your DSL. If you used Xtext to build the language, there is the Xpect framework to write nice acceptance tests for your implementation.

Related

Is there an AUTOSAR Composition-SW-Component-Type in adaptive?

I was wondering whether the AUTOSAR Composition-SW-Component-Type will apply to Adaptive i.e. in adaptive AUTOSAR, what do we call a hierarchical grouping of classic and adaptive components?
In theory? Absolutely! If you look at the meta-classes used to model the Executable it is obvious that the CompositionSwComponentType can be used.
In pratice? The time hasn‘t really come yet because of the approach for interaction of application software with the platform modules and the way how API calls identify the caller towards platform modules.
This is not so much due to hard technical limitations, there are probably ways to make it work (in a proprietary solution). But a standardization of these ways is not available.

What would be the disadvantages of building a website purely in Eiffel using EWF (Eiffel Web Framework)?

We are looking to build a website on top of an existing Eiffel business-tier core, which is sitting over a MS SQL Server database. I am presently considering the advantages and disadvantages of writing the web and mobile tiers either purely in Eiffel, purely in typical web-stacks, or some hybrid.
For us, there are clear advantages to pure Eiffel, not the least of which are:
Inheritance and other language notation mechanisms not found in other languages.
The compiler cannot see into code from other languages, so we are at the same disadvantage one we cross out of Eiffel into something else.
Auto-Test is something we heavily rely on in our Eiffel code, which takes clear advantage of Design by Contract. In other languages, we lose this power and are left with TDD (e.g. their version of Auto-Test in Eiffel).
We now have to learn more than: Eiffel, HTML-5, CSS-3, JS, and whatever JS framework(s) we use.
Every new language and tool adds more complexity to the project.
Eiffel programs are compiled to C --> EXEs, which are far faster than their scripted and interpreted counterparts.
I think there are also some clear advantages to existing, non-Eiffel languages as well:
Existing frameworks and tools can develop simple to moderate web sites and mobile applications rather quickly.
Existing "best-practices" are not terrible and producing reasonably reliable and maintainable code.
I am not sure what all of the advantages and disadvantages are, so I am asking. However, at the end of the day: Our core business suite is pure Eiffel. That will never change.
Thanks in advance for the feedback!
Here is what I can say from my own experience (I have create several web applications in different frameworks including one in Eiffel). First, the Eiffel Web Framework is quite usable right now. The advantage of other frameworks are their features. Here is a list of the major problems I encounter when I created my web application with Eiffel:
I had to create the MVC design myself (other frameworks like Django, Rails or Laravel does that automatically).
Eiffel lack is a good templating system. The Smarty library is ok, but it really lack some really good template features that other has. Also, trying to work with UTF-8 file in Smarty can be quite difficult (this has been a pain for me).
I had to do some session management based on cookies because the one in Eiffel Web Framework was quite primitive.
The release process (removing Nino) was not easy and lack good documentation (I was using Apache, I don't know about IIS)
That's it, other than that, every thing went quite smoothly.
The next list of disadvantages is from my naïve point of view:
The EWF package is not finished, it's going to have more nice capabilities in the future, therefore you may need to follow the new development to take advantage of new functionality.
Eiffel compiler makes it impossible to update a web program on the fly, it needs to be recompiled and redeployed.
If the program is going to be multithreaded, you need to learn a structured way to deal with concurrency based on the SCOOP model.
Some tools (e.g., XSLT processors) are not readily integrated into EWF, you may need to do this yourself.
The current EWF API is rather low-level, so before higher-level frameworks built on top of EWF become widespread, you may need to do more low-level programming than expected (by low-level I mostly mean the way to generate HTML/XML/or some other format your web service is going to produce).
Having to use just one language to do both application logic and HTML generation, that allows for easy debugging, may lower the requirements for the developers and their skills, that may affect your business model.
There are several tools that address specific needs like wiki, simple web-page creation, authorization, etc., but you may need to enhance them to get richer functionality as well as to design the architecture of your software, because some idioms and usage patterns are not established yet.

Which of these BDD tools are more appropriate and has more advantages for C# applications?

I would like to know your recommendation for which tool has more advantages when it comes to BDD development process:
SpecFlow
Cuke4Nuke (Cucumber port for
.NET)
Nbehave
StoreEvil
Bddify
NSpec
Nspecify
StoryQ
I personally use Cucumber (on Ruby for Windows), also it seems SpecFlow is very similar.
But I would like your recommendation on any other nice tools!
You could add MSpec to your list. MSpec is my personal favourite simply because I've used it more often/regularly. Which one you chose is, as with Unit Testing frameworks, mainly an primarily a matter of taste.
Take a couple of them out for a test run and decide based on:
Which one you feel the most comfortable with
Which has the better (online) documentation
Which has the liveliest community
You've missed out my recommendation:
Write it in code.
It's not very hard to knock up a little DSL which can support your BDD. Here's one I made earlier. Even business people can read this.
The only reason to use BDD frameworks, really, is to capture the conversations you have with your business stakeholders. The conversations are much more important! If your business stakeholders aren't reading or writing the scenarios themselves then all you do with a BDD framework is introduce another layer of indirection. (I helped write JBehave and still prefer code.)
Having said that, if you feel you get benefit from a BDD framework, I hear great things about SpecFlow.

Good combination of web application languages

I've looked around some of the asked questions and I noticed many questions dealing with THE best web application language. I'm curious into looking into a combination of web application languages, possibly some that would compliment each other well. At the moment my list of possible web app languages at the moment are:
PHP
Ruby on Rails
JavaScript
AJAX (not really a language on its own)
Grails
I know that certain ones like JavaScript and AJAX work well together but I'm curious about the rest. What about PHP and JavaScript? Does Rails play well with others? Is looking to use a combination of languages even a possibility? I know that some may be used for different kinds of applications but I would like to focus on more than just 1 of them. Thanks for the help. Any and all comments are appreciated.
You are mixing everything up.
PHP and RoR (Ruby on Rails) are server-sided scripting technologies (and Rails is not really a programming language). They can generate content that is served to the user (ie: HTML files), but they can do a lot more. You NEED a server-side language if you want to interact with your users (ie: allow them to leave comments, and etc.).
Javascript (and AJAX, partially) on the other hand runs completely on the client side. You'll mainly use JS and Ajax to improve user experience, but remember to code your site in such a way it works even if JS is off.
Generally, as a complement to your server-side scripts you need a database, and among them the most popular ones are relational DB's that support SQL (Structured Query Language), like MySQL, SQL Server, Oracle, etc.
So, what's the "best" combination for you? It really depends. Hosting with PHP+MySQL is widely available and it's cheap, and PHP has a massive user community, and many freely available libraries and frameworks for you to use. So if you are just getting into web development, I'd suggest starting with PHP+MySQL.
Rails is not a language, it's a framework. Ruby is the language.
Grails is not a language, it's a framework. The language is Groovy.
Ajax is not a language, it's a marketing term coined to describe DHTML, which was a marketing term coined to describe using JavaScript to manipulate DOM elements and styles.
Regardless if it's PHP and Python, Perl and Java, JavaScript and Erlang, you can use any languages together depending on what you're trying to accomplish.
If you're looking for something learn, I'd say JavaScript (and get down and dirty and really learn it... don't rely on a framework as a crutch) because it's the primary front-end language in the web-world. But that's just my preference.
If you could give us a little more insight into what you're working on then maybe someone can give you a better suggestion of languages to pair up.
A programming language is just a means of achieving a goal, hence the focus should always be on the goal. Just as human languages the goal is communication, hence the languages is relatively not important.
Javascript is client side scripting language, while rest of the things that you have mentioned are serverside scripting languages. No matter what server side language you use you would have to use Javascript for client side scripting.
The rest of the 3 languages are opensource languages. Personally I would choose the most popular technology because
a. There is a big community, which ensures that the technology is widely adapted because I would like other third party applications gelling well with my application.
b. Lesser no. of flaws, since someone or the other would report it and the community would try to fix.
c. Dynamic future release: Since the community would like to see feature which are there is some competitive technology they would always want to add the feature. An excellent technology which has very less community built around it dies its own death since there are no future release and slowly it falls behind the competition.
The next important criteria would be is the tech really suits my application. Like if I am using a very slow embedded system processor, I cannot use python I will have to use C.
Well in all above cases I personally love PHP. PHP has some of the best CMS s/w, which makes life easy and there is lots of code available for free and widely adapted by even enterprises.

Resources To Build a Framework

I'm thinking in create a framework, a little project with my friends, just to loose some time trying to build something, but we don't know where and how to start, then we are needing to know two things:
Which languages is possible to do this?
Where we can found some resources to begin(tutorials, sources...)?
All types of help are very welcome. Thanks.
You can use any language (that provides a mechanism for creating libraries) to build a framework.
Learn the language and development platform of choice, first. Creating a framework is just creating a library that provides a useful foundation for people.
Just trying to "Set out to build a framework" is probably not going to be too successful, however. Typically, a successful project, especially one being done for fun, is one that fills some need... Think about what you are developing, or what you want to develop. Create a project that is exciting, fun, and useful for you.
If, in the process, your project gets large, you can always pull out the building blocks and turn it into a framework for other people to use, as well.
You can create a framework in just about any language in existence, with a few common sense exceptions (such as a web server in Javascript). The most important thing to remember is that in order to make code reusable, you have to first make it usable. Your framework really has to make something simpler than doing it the original way.
Just curious, what kind of framework are you thinking about making?
If you don't know where to start, what to do or how to do it, why not join an open source project of your liking? It'll be a great starting point. You'll have the chance to observe how to design frameworks, what are the challenges, practices for writing code, and answer a lot of other questions along the way.
Then, when you'll have a concrete idea about building something, you'll already have a lot of useful knowledge on how to make it successful.

Resources