ISP Coverage Criteria - Pair-wise - unit-testing

How can I implement the ISP Coverage criteris Pair-Wise Coverage (PWC) in the input domain for the traing() function in software testing?
Input domain: enter image description here
All posible tests cases for the input domain with ACoC: enter image description here
to get this sub-input domain after implementation PWC "How can I use (PWC) to get this test cases"
enter image description here

Related

How do I match a group of text under a title that changes

New to this regex and everyone here has been an awesome resource for help but I’m running up against the wall and no matter what I cant see to get the grouping to work.
I’m looking to match the name of the room and the products and services that belong to that room. The number of rooms can vary same with the names, the description of the product or service may change but the line will always start with “Product” or “Service”.
If anyone can point me in the right direction it would be truly appreciated.
Master Bedroom
Product description of the product
Product description of the product
Service description of the service
Kitchen
Product description of the product
Services description of the service
You will probably get better results if you can use a regex alongside a bit of postprocessing. For example, the following regex will match all of the service/product lines:
(Product|Service[s]?)(.*)
But you will still need to get the name of the header. You could perhaps start with something like this:
(.*)\n((Product|Service[s]?)(.*)\n)+
In which case your capturing groups will include the name of the heading and then ALL of the lines in that section; you can then split and process each with the first regex I provided.
If you're able to share which programming language/tool you're using to run this processing, I can help you write the code to split the data correctly from the first regex.
You can look at this regex in action at regexr:
For the input string:
Master Bedroom
Product Bedknobs, cheap
Product Beautiful carpet polish
Service Free pillow sharpening
Kitchen
Product Sink grease
Services Inexpensive cucumber delivery
You will get the following groups:
Master Bedroom
Product Bedknobs, cheap
Product Beautiful carpet polish
Service Free pillow sharpening
and
Kitchen
Product Sink grease
Services Inexpensive cucumber delivery
[edit] note that this regex WILL capture the "Product/Service" string as its own group... Figured you could always throw it away if you didn't need it, but didn't hurt to have access to it after parsing :)

Amazon connect: can on choose area code and can one host more than one free instance?

I find it troublesome to get "tech support", as that should come along with a $29 bill. I only have two simple questions to ask:
Can one choose the "area code" for phone numbers (a quick search on the Documentation does not yield any mentioning)
Can one run multiple free instances of Amazon connect, each occupying a unique phone number?
Short answer to Q1 and Q2
According to the kind reply, one can pick area code freely.
Yet, Amazon Connect mimics the model of a call center. Thus, incoming calls shall arrive at a single number.
Yes, when you claim a number you can specify an area code (assuming we are talking about US area codes)
Select “Phone Numbers” from the Routing menu
Choose “claim a number”
Enter a prefix (area code) to filter the list of available numbers with a specific area code.
NOTE: you may not get results for every area code. If you are looking for a new number in a specific area code that does not show results, you would need to open a support ticket to request a number in that area code.
You can one have one number for free per account, when you add the number to the second instance you will be charged the daily rate for the number.

How to mask credit card number mask in a text?

I have a form on my website and my customers send message to me with this form. Sometimes they write their credit card number on the message. So this is really critical. I want to mask these credit card numbers. But of course card numbers don't come on a regular basis.
Example 1: 1111222233334444
Example 2: 4444 3333 2222 1111
Example 3: 4444-3333-2222-1111
Example 4: 4444 - 3333 - 2222 - 1111
Example 5: 4444--3333--2222--1111
So I can mask for example 1, 2 and 3. But if there are more than one space or dash between numbers I can't.
And this is my last regex:
preg_replace("/(?:\b| )([3456]\d{3})([ -]+){0,1}\d{4}([ -]+){0,1}\d{4}([ -]+){0,1}(\d{0})/", "$1********$2", $a1);
And results for this regex:
Result 1: 4444********1111
Result 2: 4444******** 1111
Result 3: 4444********-1111
Result 4: 4444******** - 1111
Result 5: 4444********--1111
So what should I do in regex? Thanks.
May I suggest that you separate validation of your credit card number from the presentation of that number to your users via the UI? Assuming you have only stored valid credit card numbers, then it is probably safe to assume that every number has at least 8 digits. If so, then you can just use a blanket regex to only display the first 4 and last 8 digits:
$cc = "4444--3333--2222--1111";
echo preg_replace("/(\d{4}).*(\d{4})/", "$1********$2", $cc);
4444********1111
Demo
You might point out that this puts the same number of stars in between every card number. But, then again, this is a good thing, because it makes it even harder for a snooper to fish out what the real unmasked number actually is.
Edit:
Here is a smarter regex which will star out the middle portion of any number, leaving only the first and last 4 characters visible:
$cc = "4444--3333--2222--1111";
echo preg_replace("/(?<=.{4}).(?=.{4})/", "*", $cc);
4444**************1111
Note that this solution would not remove anything from 11114444 as a theoretical input.
How to mask credit card number mask in a text [with regex]?
Don't.
Sometimes they write their credit card number on the message.
They really shouldn't. Don't encourage this behavior. It is not PCI compliant:
What is PCI Compliance?
The Payment Card Industry Data Security Standard (PCI DSS) applies to companies of any size that accept credit card payments. If your company intends to accept card payment, and store, process and transmit cardholder data, you need to host your data securely with a PCI compliant hosting provider.
When you accept credit card data via a website, do so using an approved service provider like Stripe, PayPal, BlueSnap, SecurionPay, etc. These services are immensely popular not because it's hard to make payment systems, but because they're hard to make right (and legal). They all have PHP API's, so you can have people enter credit card data that you never see, and still charge them for amounts that you agree upon.
For example, if you were using Stripe and you wish to inform your customer what credit card they signed up with, their card object has a last4 property that gives the last four digits of the card: At this point you never knew the full credit card number, and you didn't even have to consider whether giving the first four and the last four was a security violation.
Further guidelines:
Never store electronic track data or the card security number in any form
While you may have a business reason for storing credit card information, processing regulations specifically forbid the storage of a card’s security code or any “track data” contained in the magnetic strip on the back of a credit card.
The card security number, called by many acronyms including CVV2, CID, and CSC, is the three digit number on the back of Visa/MasterCard/Discover cards or the 4 digit number on the front of American Express cards. It is designed to provide a way for merchants to know whether a customer authorizing a transaction over the phone or via the Internet actually has the card in their possession. This approach only works if the security code is never stored with the card number. Electronic storage makes this easy. You simply do not create a field for the security code. For paper storage, you need to redact (cross out with a dark pen to make unreadable) the security code after you successfully process the transaction and before you store a paper authorization form. [...]
Clearly you should store neither security codes nor track data purposely. But, you need to make sure you don’t store it inadvertently as well. To do this, be certain to use only approved hardware and software. [...]
Make sure all electronic storage of credit card account numbers is encrypted and all paper storage is secured
[...] Electronic storage of credit card numbers is also common if, for example, you process recurring or repeat transactions. If you do this, you need to make certain that you never store these files unencrypted. You need to make certain that any electronic storage is encrypted using a robust encryption algorithm. That way, if your computer is stolen or if someone in your office gains unauthorized access, you have some level of protection for the credit card numbers.
There are many service providers that offer secure storage—either as a standalone service or as part of a payment processing package. These services typically provide you with a “Token” for a card number they store. You can store the token in any unsecured file. When you’re ready to process a payment, you simply send the service provider the token and it retrieves the full card number for the sole purpose of processing the payment. (It’s technically more complicated than that, but you get the idea.) Just be certain to use a PCI DSS Verified provider [...]
Check the next regex \b([3-6]\d{3})(?: *-* *\d{4}){2} *-* *(\d{4})\b.

Regex: Recognizing and removing lists and menus

Before I write my own method, I am curious whether there is a regex that can help me.
The Context
I am cleaning raw text prior to running statistical analyses on the terms. The text is from websites and thus includes menus (many menus from many websites).
A typical list/menu appears as follows (Except with one line break between items):
STUDENT SERVICES
Guidance & Support
Core Services
Admissions & Records
Financial Aid
Counseling
Assessment Testing
Kickstart Orientation
Tutoring
Career & Transfer Center
Student Welcome Center
The Task at Hand
I want to remove all lists
I need to remove text blocks where there is a line break after every first second, third or fourth word, but only if this pattern repeats 3 or more times consecutively (I don't want to remove single short sentences such as "Students always succeed.")
Can a regex identify this pattern?
NOTE: I am working in java.
UPDATE with sample text
[[[I WANT TO REMOVE THIS LIST]]]
Offices & Services
Student Services
Activities & Athletics
Records & Registration
Costs & Financial Aid
Compliance & Diversity
Alumni
Faculty/Staff Resources
BMCC Foundation
Human Resources
BMCC Homepage>Academics>Health Education>Course Listings
[[[I WANT TO REMOVE THIS LIST]]]
Health Education Home
Course Listings
Faculty
[[[I WANT TO REMOVE THIS LIST]]]
Community Health Education
Gerontology
School Health Education
Public Health
Visit Admissions
Course Listings
[[[I WANT TO KEEP TEXT BELOW]]]
The following courses are offered by the Department of Health Education.
2CRS., 2HRS, 0 LAB HRS.
HED 100
Health Education
This is an introductory survey course to health education. The course provides students with the knowledge, skills, and behavioral models to enhance their physical, emotional, social, intellectual and spiritual health as well as facilitate their health decision-making ability. The primary areas of instruction include: health and wellness; stress; human sexuality; alcohol, tobacco and substance abuse; nutrition and weight management; and physical fitness. Students who have completed HED 110 - Comprehensive Health Education will not receive credit for this course.
3CRS., 3HRS, 0 LAB HRS.
HED 110
Comprehensive Health Education
This course in health educations offers a comprehensive approach that provides students with the knowledge, skills, and behavioral models to enhance their physical, emotional, social, intellectual and spiritual health as well as facilitate their health decision-making ability. Areas of specialization include: alcohol, tobacco and abused substances, mental and emotional health, human sexuality and family living, nutrition, physical fitness, cardiovascular health, environmental health and health care delivery. HED 110 fulfills all degree requirements for HE 100. Students who have completed HED 100 - Health Education will not receive credit for this course.
Assuming the part about the number of words is not important, try a regex pattern of (([A-Za-z& ])*(\n|\r|\r\n)){5,}, example here.
Change that five quantifier as needed, that is just an example. A five would not match two lines with an extra newline or a three line list without an ending new line.

What data areaCode and metroCode columns contain for in maxmind?

As i inderstand area code - is regional telephone code, right?
What for metro code column stays for then?
Metro Code is a DMA code like "803" for Los Angeles, as defined by Google AdWords. Area code is, indeed, the telephone prefix after the country code.
https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions
A metro code is a zip code like in the states, e.g. 24100