Present Perfect and Present Perfect Continuous Tenses

Present Perfect Tense

Form
Affirmative
I have written.
He has written.
They/you/we have written.

Negative
I have not written.
She has not written.
They/you/we have not written.

Interrogative
Have I written?
Has he written?
Have they/you/we written?

The present perfect tense is used to talk about an action just completed.
Read the sentences given below.

I have finished the story.
They have returned.
She has applied for leave of absence.

The present perfect tense can also be used to talk about an action which began some time in the past and has continued up to the present.

I have always wanted to learn the art of painting.
We have lived in this city for several years.
I haven’t seen him for a long time.

To talk about past actions that cannot be attributed to a definite time

The present perfect tense can be used to talk about past actions which cannot be attributed to a definite time.

I have visited Canada and Australia.
I have written several short stories.
I have often gone to that theatre.
She has acted in a film.

Here we are talking about past actions but we do not state when that particular past action took place. Note that we use simple past tense to talk about past actions which can be attributed to a definite time.

Compare
I visited Canada and Australia last year. (NOT I have visited Canada and Australia last year.)
I wrote several short stories last week. (NOT I have written several short stories yesterday.)
I wrote to him yesterday. (NOT I have written to him yesterday.)

Notes

No adverbs of time referring to the past can be used with the present perfect tense. If you have to, use simple past instead.
However, certain adverbs like ever, always, never, constantly etc., can be used with the present perfect tense.

I have never seen him before.
Have you ever been to Kashmir?
He has constantly eluded the police.
John has always been a rebel.

The Present Perfect Continuous Tense

Form
Affirmative
I have been writing.
She has been writing.
They/you/we have been writing.

Negative
I have not been writing.
She has not been writing.
They/you/we have not been writing.

Interrogative
Have I been writing?
Has she been writing?
Have they/you/we been writing?

The present perfect continuous tense is used to talk about an action which began sometime in the past, has gone on till the present and is still continuing.

She has been sleeping for four hours.
I have been working in the garden since morning.
It has been raining since yesterday.

In the sentence She has been sleeping for four hours, she started sleeping four hours ago, slept without stopping for four hours and is still sleeping.
Note that we use the present perfect continuous tense to emphasize the duration and continuity of the action.