How to test a user's code? [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
My query is very basic one but just want to know the exact things which occur behind the bars and how. Lets say, I am given a question to code. User submits the code in any language(I'd like to go for C or C++ here specifically), now the code gets tested on various test files at the server side. How this happens? As I think and searched, there must be a code at the server side which must be accepting solutions(user's code) from the client in form of the file, then run that file on various test files(which will have all test cases according to the input and output specified in the problem description) and match the output. Is it? I think there is something else or something which I am mistaken.
If I have a very simple program to add two numbers, now I want to test the user's code, what exactly do I have to do? I am asking from the implementation point of view i.e. I want to actually do and test the same on my machine. Can someone please tell me from basic what all I should do?(Much the same way online judges do)
PS: I am not asking this for hosting any contest etc, just doing out of curiosity for learning.

I would divide this into two sub goals
learning automated testing
setting up some application which allows the user to submit testcases, run the automated tests and reports feedback
You could start to get some deeper insight by setting up automated tests for some program in your favourite programming language.
Use a search engine to e.g. look for "automated c++ testing".
If you have managed setting up a few automated tests on a local machine, your could then progress with the second goal.
For example you could set up a Jenkins instance and learn how to add automated tests to it.

Related

Django and Bootstrap relationship [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm working on a development road map for a django project. My choosen IDE is pycharm pro and mock up tool is bootstrap studio. One of my criteria is a calendar and I have discovered that none of the existing public projects will meet my needs so I will have to create one from scratch (no problem). My typical approach would have been that the UI and the django project would be done in near parallel periodically merging and diverging the two. However, given the ability of the two software tools, I'm starting to think that that a better approach may be to do the UI first in BSS, next import the templates into the django project and finally perform the django dev to meet the needs of the UI.
The specific calendar functionality is not the issue here, this is a methodology question. While I know that there is a subjective answer to this question (which is not the "answer" I'm looking for here), there also has to be an objective answer as to why this would not work, or be the incorrect approach.
Doing the UI first is fine if you already know exactly what you want it to do and can specify that. Doing the Django first lets you play around with a working rough version and get a better feel for what works best before fine tuning the look and feel. Like you suggest, working on them both together will let each inform the other.

Automated tests in RPA [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm not very familiar with a concept of testing in programming languages although I know the basic idea and some of the principles to test your code like unit tests and stuff. I haven't written any tests myself yet but the general idea is more or less clear. But when it comes to Robotic Process Automation I get stuck with how I should properly test my workflows.
If I have modules which don't interact with any interface then I can clearly create a test environment, that is a function and this function will pass some arguments and get the result which will be compared to the expected one.
But what are best practices to test the parts of a workflow which interact with interface and contain clicks, type into and all those things?
If anyone has any experience of creating automated tests in RPA, for instance, in UiPath, I would be grateful to see it explained. Any ideas, irrespectively to the proper experience lack or presence, would be highly appreciated anyway.
By the way if anyone worked in UiPath he could notice that they developed the so called ReFramework which follows best practices in RPA deployment according to their words. In this Framework they got a test folder and some test modules but I don't get how they work and how I should adjust them in order to match a program developed by myself.
Thanks for the question.
I am a RPA developer, and also tested the workflows but don't as a "Tester" perspective.
If you look there are many things to test.
case#1
As you said you are dealing with web portal, you might use click activity. There is one property called selector which is auto generated. Selector identify the UI element. There are many attribute in selector that may be static.This is wrong practice
lets take example
Submit
in this idx and uipath_custom_id attribute are a static, this might change accordingly but the name Submit and class never change, So as a tester you can find this type of mistakes by the Developer...
Keep in mind that never give static values or numbers to any attribute in the selectors...Instead of that use
(* and ?)
https://studio.uipath.com/v2017.1/docs/selectors-with-wildcards
It also happen that there are two buttons in web page having same name, same class so the selector which is generated is also some what same except ID so you need to take care of this also as considering ID always changes.
Always keep your workflow small, use proper activity and keep business logic in separate sequence activity Such things you can test. Also you can test the Optimization of the flow.
If you are dealing with other application like Excel or SAP check that you can close it after your work done.
Such things you can test
Thanks
It will be better if you tell the scenario so that community can help you tell about the test cases...:)

How to automatically detect bugs in a web application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a web application in Vaadin. It has got some forms, search fields, buttons, etc and supported by a SQL database. I have been using Selenium, Sahi Open Source and some other tools for automated GUI testing.
Problem is: With recording GUI actions for automated testing isn't really useful because it seems more manual work than automated because I need to record the tests manually anyway.
Question is: Is there any better way to test a Web Application? How do you test your web application? Is there any free tool which automatically detects bugs in my web application?
This won't be possible unless someone will invent sentient AI and even that might not be enough. In our company we have separate QA department (they're intelligent human beings) and they keep asking questions like "how we're supposed to test this flow" and "is this the expected response".
Without test that is aware of the business flow that you're limited to what bots do - randomly crawl trough site and try to get "500 page" and that is not enough. If you're tired of writing tests you can:
Use static code analysis tool (like jshint) to check if your code is written in "best practices" way
Use your users as testers (have streamlined release process, and mechanism of reporting error so you can address production bug as quickly as possible)
Hire someone to write the test for you
There are lots of ways to test software. None of them are fully automatic; they all require that actual behavior be compared against expected behavior, and expected behavior cannot be automatically inferred by a machine but must instead be prescribed and defined by humans, and then translated to a language that a machine can understand and use to determine whether it matches the actual behavior.
Here is a starting point to start reading about other ways to test your software:
https://en.wikipedia.org/wiki/Software_testing

Window - Lock Program Background [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to lock a program in background by adding a service to background. The user needs to input password to use the program.
sc create newservice binpath = "C:\Users\User\Test.exe"
The problem is, I am not sure that How can I write the program.
First, what programming language can I use? Cmd, C++ or others?
Second, how can I write this exe?
I have heard this from my friend, but I am not sure how to write this.
Any help will be appreciated.
First note, background process not must be service.
Second note, if you wish wrote service, take in account Vista and above session isolation. Also service may run in another account.
Third note. How do you 'trap' browser? Code injection? Finding by process name/ window name? .... Many counterattacks exists, so this is not trivial thing.
Forth note, What if stop service or close/kill your process?
Fifth note, how do you wish store passwords? If as plain text, every skilled person obstruct your app. If encrypted, more code you must wrote...
Sixth note, nobody on SO.com wrote code for wish without you.

How to code a new Windows Shell? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How would I go about coding a new Windows Vista Shell?
Everything you need to do as shell has never been documented, so there are some issues with file change notifications etc. The basics are:
SystemParametersInfo(SPI_SETMINIMIZEDMETRICS,...MINIMIZEDMETRICS) with (undocumented?) flag 8
Register as the shell (SetShellWindow,SetProgmanWindow,ShellDDEInit,RegisterShellHook etc)
Hide welcome screen by setting a signal ("msgina: ShellReadyEvent" and "ShellDesktopSwitchEvent")
Start registry run key, start menu\startup and ShellServiceObjects
Set registry Explorer\SessionInfo
The good thing is, you are not the first to write a new shell, if you look around, you can find some obscure required info. Here is a list to get you started:
https://web.archive.org/web/2019/http://www.lsdev.org/doku.php
http://bb4win.cvs.sourceforge.net/bb4win/blackbox/Blackbox.cpp?revision=1.49&view=markup
http://xoblite.net/source/Blackbox.cpp.html
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/
http://www.geoffchappell.com/viewer.htm?doc=studies/windows/shell/explorer/index.htm&tx=36
A good place to start would be investigating how to build a command line parser, something that can tokenize and interpret the inputs. There are tools that can help with this like ANTLR, or you might like to try building your own.
Once you've parsed the inputs you need to decide what actions to take - launching processes, piping between processes, redirecting output - and making those system calls.
If you're just after a more powerful shell rather than interested in building one, give PowerShell a try.