BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vishu
Fluorite | Level 6

How do Automated or Unit Testing actual works on sas programs/DI JOBS in SAS DI STUDIO?

Is there any SIMPLE practical scenario or example available to understand the concept of testing in real sas di project??

Than

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Well since no one else has responded.....

I don't actually use DI Studio but if I did then I would test DI jobs the same way I test all my SAS work that is going to be productionised:

1) Aim for as clean a SAS log as possible. That means no errors, no warnings, and no notes about potential problems like missing values. The benefit of this is that if any problem does happen it is a lot easier to spot.

2) Confirm if the outputs are what are wanted.

3) Confirm the accuracy and correctness of the results. This includes comparing SAS datasets to ensure the right results are being derived and that nothing else is broken in the process. I am a total fan of PROC COMPARE for dataset comparisons. Doing a check comparing a BEFORE version with an AFTER version is in my view an essential and highly efficient and valuable way of testing.

4) Confirm that the job works reliably, consistently, and efficiently, and fits in with other production jobs.

There is no such thing as automated testing. 

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

Well since no one else has responded.....

I don't actually use DI Studio but if I did then I would test DI jobs the same way I test all my SAS work that is going to be productionised:

1) Aim for as clean a SAS log as possible. That means no errors, no warnings, and no notes about potential problems like missing values. The benefit of this is that if any problem does happen it is a lot easier to spot.

2) Confirm if the outputs are what are wanted.

3) Confirm the accuracy and correctness of the results. This includes comparing SAS datasets to ensure the right results are being derived and that nothing else is broken in the process. I am a total fan of PROC COMPARE for dataset comparisons. Doing a check comparing a BEFORE version with an AFTER version is in my view an essential and highly efficient and valuable way of testing.

4) Confirm that the job works reliably, consistently, and efficiently, and fits in with other production jobs.

There is no such thing as automated testing. 

vishu
Fluorite | Level 6

Thank you so much for your Answer.

It helps me for understanding concept.Smiley Happy

gregorysnelson
Obsidian | Level 7

Hi,

I wanted to follow up on this question as this is something near and dear to my heart - test-first design (TFD) and automated unit testing. 

Philosophically, methodologies that take advantage of robust development processes are critical IMHO. Most SAS Programmers are not Developers - that is, most write their programs against the data, whereas Developers write their programs against requirements.  That distinction is very important in determining whether you (or your organization) have the support that you will need to utilize TFD.  The reason being is that this will require discipline and commitment to the approach.

With that being said, I have included some references to our thinking on how you can/ should implement TFD in your SAS programming practices.

FUTS - an open source framework for Unit Testing in SAS

Using FUTS with Test First Design - SGF/ SUGI Paper

Unit Testing Frameworks for SAS (Wiki)

Robustness in SAS Applications (PhUSE Wiki)

Hope this helps.

-greg

-greg

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2691 views
  • 1 like
  • 3 in conversation